Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Apr 7th, 2007, 6:00 PM   #1
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
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
kurifu is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC