944,209 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1916
  • C RSS
Feb 14th, 2006
0

how do I send structures using csocket across network?

Expand Post »
I use CSocket with send() and recv() to send and receive structure packets of type Packet as follows:

class Packet {
int dataLen;
char data[1024];
} packet;


I tried but the received structure elements contained garbage. What would the code be on the send and receive sides of the app ? Please help.

Rgds.
perlsu
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
perlsu is offline Offline
17 posts
since Sep 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: reading a file...please help
Next Thread in C Forum Timeline: How do I pass the multiple parameters to arglist of _beginthread?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC