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.
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.