c++ - Sending own class as binary data over socket
- Masterchief (10/10) Jan 22 2007 Hy!
- Brecht Machiels (9/26) Jan 22 2007 Hello,
- Bertel Brander (13/26) Jan 22 2007 I have some code that could be used as a start, but I have to
- Masterchief (9/40) Jan 23 2007 Yes
- Pavel Vozenilek (8/14) Jan 24 2007 On http://www.codeproject.com/threads/Rcf_Ipc_For_Cpp.asp
Hy! I am trying to develop a Client Server Communication over TCP/IP. I want to use an own Message class and send this class as binary data over a socket. I want to use stream operators for reading and writing to the stream. How do I convert a class to binary data to send it? How do I use a socket and stream operators for reading and writing? Thanks a lot. Examples would help a lot:-) Ronny
Jan 22 2007
Hello, you might want to look into the CORBA framework for the passing of objects. Using this framework you will not have to worry about socket programming. There should be plenty of documentation on socket programming on the net. A good book might be better though. Regards, Brecht Masterchief wrote:Hy! I am trying to develop a Client Server Communication over TCP/IP. I want to use an own Message class and send this class as binary data over a socket. I want to use stream operators for reading and writing to the stream. How do I convert a class to binary data to send it? How do I use a socket and stream operators for reading and writing? Thanks a lot. Examples would help a lot:-) Ronny
Jan 22 2007
Masterchief skrev:Hy! I am trying to develop a Client Server Communication over TCP/IP. I want to use an own Message class and send this class as binary data over a socket. I want to use stream operators for reading and writing to the stream. How do I convert a class to binary data to send it? How do I use a socket and stream operators for reading and writing? Thanks a lot. Examples would help a lot:-)I have some code that could be used as a start, but I have to adjust it to Digital Mars. There are some questions: Do you have full control of both ends of the socket? Do both ends use the same hardware and compiler? Do the classes that is to be send use virtual methods? Do the classes have pointers to data, or is it only POD and arrays? -- Just another homepage: http://damb.dk But it's mine - Bertel
Jan 22 2007
Hy!There are some questions: Do you have full control of both ends of the socket?YesDo both ends use the same hardware and compiler?YesDo the classes that is to be send use virtual methods?NODo the classes have pointers to data, or is it only POD and arrays?I think I will just use arrays. The code would be very helpfull. Thanks a lot. "Bertel Brander" <bertel post4.tele.dk> schrieb im Newsbeitrag news:ep33ni$13p1$1 digitaldaemon.com...Masterchief skrev:Hy! I am trying to develop a Client Server Communication over TCP/IP. I want to use an own Message class and send this class as binary data over a socket. I want to use stream operators for reading and writing to the stream. How do I convert a class to binary data to send it? How do I use a socket and stream operators for reading and writing? Thanks a lot. Examples would help a lot:-)I have some code that could be used as a start, but I have to adjust it to Digital Mars. There are some questions: Do you have full control of both ends of the socket? Do both ends use the same hardware and compiler? Do the classes that is to be send use virtual methods? Do the classes have pointers to data, or is it only POD and arrays? -- Just another homepage: http://damb.dk But it's mine - Bertel
Jan 23 2007
"Masterchief" wrote:I am trying to develop a Client Server Communication over TCP/IP. I want to use an own Message class and send this class as binary data over a socket. I want to use stream operators for reading and writing to the stream. How do I convert a class to binary data to send it? How do I use a socket and stream operators for reading and writing?On http://www.codeproject.com/threads/Rcf_Ipc_For_Cpp.asp is a tool to serialize any C++ class and send it over the wire. Once DMC will be able to deal with Boost this library should work as well. IMHO DMC has a good chance to reach this state, based on the feedback for bug reports. /Pavel
Jan 24 2007