Strange Packet

Jul 18, 2010 at 5:39 PM

I've been packet sniffing my own sended packets and it seems like they are almost the same every time, doesn't matter what the size of the packet string I'm sending

This is the packet:

..........................ANetSockets, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null......NetSockets.NetObject.....<Name>k__BackingField.<Object>k__BackingField.............NewPlayer.

 

And in bytes:

BB 00 00 00 00 01 00 00 00 FF FF FF FF 01 00 00 00 00 00 00 00 0C 02 00 00 00 41 4E 65 74 53 6F 63 6B 65 74 73 2C 20 56 65 72 73 69 6F 6E 3D 31 2E 31 2E 30 2E 30 2C 20 43 75 6C 74 75 72 65 3D 6E 65 75 74 72 61 6C 2C 20 50 75 62 6C 69 63 4B 65 79 54 6F 6B 65 6E 3D 6E 75 6C 6C 05 01 00 00 00 14 4E 65 74 53 6F 63 6B 65 74 73 2E 4E 65 74 4F 62 6A 65 63 74 02 00 00 00 15 3C 4E 61 6D 65 3E 6B 5F 5F 42 61 63 6B 69 6E 67 46 69 65 6C 64 17 3C 4F 62 6A 65 63 74 3E 6B 5F 5F 42 61 63 6B 69 6E 67 46 69 65 6C 64 01 02 02 00 00 00 0A 06 03 00 00 00 09 4E 65 77 50 6C 61 79 65 72 0B

 

Why it's sending "ANetSockets, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null......NetSockets.NetObject.....<Name>k__BackingField.<Object>k__BackingField" ?

The packet will be probably sended faster if it will only send the data you asked him to send

Coordinator
Jul 18, 2010 at 6:34 PM

I'm guessing your using the Object Client/Server classes? These classes utilize .NET serialization in order to send the data. The packets will thus contain some extra information that the .NET framework uses for deserialization.

The project home page explains what the "object" classes do:
"The "object" classes provide a stream, client, and server that communicate using payloads of a specialized NetObject payload. This payload consists of a payload name and a .NET object. This is then serialized and sent as a binary payload. When the payload is received, it is deserialized back into a NetObject. This provides an extremely easy way of communicating with standard and custom .NET data types. However, performance requirements should be considered before using this method - as .NET serializing results in an overhead when in binary form."

If you intend to send simple data (such as strings or bytes) consider using the Simple, Payload, or String classes instead.

Jul 18, 2010 at 7:28 PM

I'm just using some functions from the NetBox project i don't know about which classes Ur talking about but can you maybe show some code for how to use it ? thanks