Board index » cppbuilder » Socket SendBuf & ReceiveBuf

Socket SendBuf & ReceiveBuf


2007-09-25 08:10:53 PM
cppbuilder85
Hello,
I'm trying to connect two applications in different computers through a
client-server socket connection. I'm interesting to send a big amount of
data and I don't know how to do it.
First of all, I thought to use SendBuf / ReceiveBuf (i.e : SendBuf (Buf,
sizeof(myclass))). However, it shouldn't work because of I cannot send
memory addresses?
Any idea ? .Aitor
 
 

Re:Socket SendBuf & ReceiveBuf

Aitor Matilla < XXXX@XXXXX.COM >writes:
Quote
I'm trying to connect two applications in different computers
through a client-server socket connection. I'm interesting to send a
big amount of data and I don't know how to do it.

First of all, I thought to use SendBuf / ReceiveBuf (i.e : SendBuf
(Buf, sizeof(myclass))). However, it shouldn't work because of I
cannot send memory addresses?
You can well send (and receive) memory addresses. The questions is
whether the receiving side can do anything useful with a received
memory address.
This will be a problem if you think about sending data structures that
consist of different parts which refer to each other using
pointers. That problem isn't specific to SendBuf / ReceiveBuf, though.
You will need some format that represents these references in a way
that allows the receiving side to recreate them. E.g. XML ID/IDREF
pairs.