jeudi 14 juin 2018

why sys socket recv function don't fill data but return bytes length?

I'm writing c++ client. the client connect to server with TCP protocol successfully and send data too. i wrote code below to receive data :

char data[9];
int received_size = recv(fd, data, 9, flags);

which flags is MSG_NOSIGNAL.

the problem is after this line the received_size is 9 but the data length is zero.

Aucun commentaire:

Enregistrer un commentaire