Page 2 of 2
Posted: Fri Oct 03, 2008 3:16 pm
by Trond
I'd guess that multiple SendNetworkData() may be received out of order if you're unlucky.
Posted: Fri Oct 03, 2008 4:21 pm
by freak
No, TCP/IP ensures that the order is correct.
You may just receive the data in different sized chunks than it was sent.
Posted: Fri Oct 03, 2008 6:58 pm
by EdzUp[SD]
ok

Posted: Sat Oct 04, 2008 1:08 am
by Lykaestria
freak wrote:...You may just receive the data in different sized chunks than it was sent.
Errrrmm, why?

Posted: Sat Oct 04, 2008 10:59 am
by EdzUp[SD]
I think its the way everything goes through the internet you just have to stick it in a buffer till you got the packet then process it, I will add a footer and header to each packet to get the information required to process the packets.
Posted: Sat Oct 04, 2008 12:42 pm
by freak
Lykaestria wrote:freak wrote:...You may just receive the data in different sized chunks than it was sent.
Errrrmm, why?

Because the data is just a stream of bytes. The other side cannot determine which data belongs to the same SendNetworkData() command.
You always receive the data that is currently available. That could be half of one send, or multiple ones together.
Posted: Sat Oct 04, 2008 12:57 pm
by DoubleDutch
Trond wrote:Global Longvariable.l
Global Floatvariable.f
Global DoubleVariable.d
SendNetworkData(ClientID, @Longvariable, 4)
SendNetworkData(ClientID, @FloatVariable, 4)
SendNetworkData(ClientID, @DoubleVariable, 8 )
Trond: Nice, I'm pinching that.

Posted: Fri Oct 17, 2008 11:27 am
by EdzUp[SD]
Freak maybe you can answer this one, will the data arrive in the same order it was sent? If not then sending a type would be pointless.
Posted: Fri Oct 17, 2008 11:32 am
by DarkDragon
EdzUp[SD] wrote:Freak maybe you can answer this one, will the data arrive in the same order it was sent? If not then sending a type would be pointless.
Learn reading:
freak wrote:No, TCP/IP ensures that the order is correct.
Posted: Fri Oct 17, 2008 5:51 pm
by EdzUp[SD]
So basically sending a structure through the network is useless as if you have multiple values in that type it doesnt arrive correct so there is no way of knowing what is what:
For example sending:
ClientID.l, Class.l, Information.l
Could arrive as:
Class.l, Information.l, ClientID.l
hence useless, this is why I asked for the string thing in the first place as you could then pack everything into one string and send that over the network and read in what arrived. This is how the BlitzMax version of Elite Multiplayer worked and it worked fine, in PB I need the date to be in sequence as there could be as many as 256 players in one server and that would be a load of useless data flying around waiting for it to get into sequence.
Posted: Fri Oct 17, 2008 6:04 pm
by blueznl
NOOOOO. At least not in TCP/IP.
Bytes arrive in the order you sent. You just don't know when they arrive and how many arrive in each batch.
So sending A.l B.l C.l means they arrive as A.l B.l C.l.
Period.
UDP is a different story.
Posted: Fri Oct 17, 2008 6:06 pm
by EdzUp[SD]
THANK YOU blueznl thats all I needed to know

Posted: Fri Oct 17, 2008 6:40 pm
by DarkDragon
EdzUp[SD] wrote:THANK YOU blueznl thats all I needed to know

Freak said exactly the same: The order will be like you've sent it in TCP. I think you don't understand the comma symbol ",".
Posted: Fri Oct 17, 2008 7:45 pm
by EdzUp[SD]
I do know what a comma is thank you very much, what I wanted clarification on was the packets coming through.