Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

header files

Name: Anonymous 2009-10-11 22:06

So I'm basically making a mini version of IRC, with one server that handles connections from a lot of clients.  Then I decided I would pretty much make my own protocol, with a header attached to every operation.  Every operation, sending text, sending a file, creating/joining a room, would have a header attached to it with details like receiver and sender IDs, time stamp, etc. 

So this sounds nice and all in theory, but I'm absolutely at a loss at how to code this thing.  How would I join the header object to the data object?  concat?  Except I don't know wtf that is.  After a client receives something, how would it separate the header from the data?

And making the header... if I create a new header, decide that its sub-operation is going to be "sending," how do I send it to the file class, have the file class create the sub-op packet, and return it?  It all makes sense conceptually but writing the code is hitting me like a brick wall.

Name: Anonymous 2009-10-11 23:19

>>12
So you have some header data and some body data that you want put together?  If they are strings, just use the + operator in C#.  If they are other data objects, just make an array and put the header in the first half and data in the second half and loop through the array sending it piece by piece.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List