perlsu 0 Newbie Poster

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.