![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Expert Programmer
|
Binary Serialization vs. Byte Streams
Remeber back in C++ when to send a packet from one end point to another you create some structure for your packet headers and data, casted it into a bytstream sent it and then interpreted it again on the opposite end based on the header data?
Well I am about to tackle the task of creating a TCP Server/Client application only this time in C#. The good news is that the TcpClient and TcpListener classes take a lot of the monotonous base work out of creating a stable setup (and managing the sockets); however it leaves me wondering about sending the data from one point to another. I will be dealing exclusively with binary data, no text. So again I will have to create a series of classes/structure which represent the various message that will be going across the wire; however having worked in the past with Xml and Binary Serialization to save data to disk, I am wondering if this would be a good approach to serializing the messages I am going to be sending across the network? It does seem to be much easier than fiddling with the InterOp capabilities of my structures and specifying the memory layout so that I can produce a reliable byte stream, but I want to make sure that I am not sacrificing huge amounts of efficiency by using Binary Serialization. If binary serialization works anything like XML serialization extra data will be added into the bytestream to describe the values, this would produce overhead, though I am not sure how much yet. Any insight?
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| linked list & binary tree questions | n00b | C++ | 14 | Nov 4th, 2006 3:24 AM |
| Java code to convert binary to decimal and hexadecimal to binary | prince_haldir | Java | 1 | Mar 7th, 2006 2:51 AM |
| Binary | Ubert | Other Programming Languages | 8 | Sep 23rd, 2005 11:09 AM |
| Reading Delphi Binary | kcnz | C# | 2 | Aug 7th, 2005 11:35 PM |
| hey guys can anyone tell me how to convert from binary file | midotec | C# | 0 | Mar 10th, 2005 12:30 PM |