RE: network programming

  • From: "Sina Bahram" <sbahram@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 3 Jun 2009 20:39:17 -0400

On the other hand, if you're dealing with actual packets, you might want to
just use the write command and  write the binary structure to the socket.

Take care,
Sina
 

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Ken Perry
Sent: Wednesday, June 03, 2009 7:14 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: RE: network programming


Me I would use boost library and the serialize class that makes it simple to
turn a structure or class into an xml structure and extract it on the other
end.

Ken

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Tyler
Littlefield
Sent: Wednesday, June 03, 2009 12:37 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: network programming

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

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

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

Other related posts: