network programming

  • From: "Tyler Littlefield" <tyler@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 3 Jun 2009 10:36:35 -0600

Hello list,
I've got a question. I've been working on a program, and I have a document that explains the protocol and how things work. It's about 20 pages so far, but it'll probably get revised to be shorter once I start doing the actual work and seeing whether things will work.
My question is this:
I'm working with a structure that looks something like:
struct packet
{
MessageType mtype;
int DataLength;
char* data;
};
How would I go about serializing that so that it'll go across the stream? I'll need to memcpy the data I'm thinking, no? I'm also looking at encryption; I need to find some sort of way to let the client encrypt with the host, without a predefined key; the only way I can think of is for the host to build a random key, but then it'd have to send it cleartext to the client, which is rather counterproductive.



Thanks,
Tyler Littlefield
Web: tysdomain.com
email: tyler@xxxxxxxxxxxxx
My programs don't have bugs, they're called randomly added features.

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: