Allow Ascii character 0 in strings
-
- User
- Posts: 76
- Joined: Wed Sep 17, 2008 3:10 am
- Location: New Zealand
Because the data is just a stream of bytes. The other side cannot determine which data belongs to the same SendNetworkData() command.Lykaestria wrote:Errrrmm, why?freak wrote:...You may just receive the data in different sized chunks than it was sent.
You always receive the data that is currently available. That could be half of one send, or multiple ones together.
quidquid Latine dictum sit altum videtur
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Trond: Nice, I'm pinching that.Trond wrote:Global Longvariable.l
Global Floatvariable.f
Global DoubleVariable.d
SendNetworkData(ClientID, @Longvariable, 4)
SendNetworkData(ClientID, @FloatVariable, 4)
SendNetworkData(ClientID, @DoubleVariable, 8 )

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
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.
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.
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.
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.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact: