H
Hans Nieser
Hi,
I'm pretty new to C#, and recently I have been experimenting with sockets.
However, I can't find a nice way (I've been fiddling with for-loops to no
avail) to parse the data that comes in over the socket. I realise this is
a bit of a general subject and there must be some good articles on it, so
any pointers to a good article dealing with this are welcome.
One problem in particular was a response form a gameserver containing
status info. The response basically consists of ASCII values, where each
value has 1 byte prepended to it indicating the field's length (if the
value would have been 3 bytes, the length would be 4).
To make it slightly more complicated, the response also has a few 0x00
(SOH in ASCII) bytes in it, indicating different parts of the response
(kinda like a seperator, seperating general server info, server rules and
players). Also, the last part of the response has a few ASCII values
(player info) 'grouped' by having an extra byte (0x1d if memory serves me)
prepended.
Any help is greatly appreciated.
I'm pretty new to C#, and recently I have been experimenting with sockets.
However, I can't find a nice way (I've been fiddling with for-loops to no
avail) to parse the data that comes in over the socket. I realise this is
a bit of a general subject and there must be some good articles on it, so
any pointers to a good article dealing with this are welcome.
One problem in particular was a response form a gameserver containing
status info. The response basically consists of ASCII values, where each
value has 1 byte prepended to it indicating the field's length (if the
value would have been 3 bytes, the length would be 4).
To make it slightly more complicated, the response also has a few 0x00
(SOH in ASCII) bytes in it, indicating different parts of the response
(kinda like a seperator, seperating general server info, server rules and
players). Also, the last part of the response has a few ASCII values
(player info) 'grouped' by having an extra byte (0x1d if memory serves me)
prepended.
Any help is greatly appreciated.