Problem while recieving data on Socket
Hi Guys,
I am using socket for tcp/ip communication.
I have created socket and connected to server which is server.exe on another machine all the thing are ok.
client_socket = socket(AF_INET, SOCK_STREAM, 0);
connect (client_socket, (SA *) &server_address, sizeof(server_address));
Now I am trying to read hex data on socket, it receive proper data if receiving data not contains 0xff. But if comming data contains 0xff, whenever it encounter in receiving packet it return number of byte up 0xff. latter on the function breaks. I have tried received data using both the function below but it gives me same result.
data = read (client_socket, &recv_buff, 50); //read data packet of 50
data = recv(client_socket, &recv_buff, 50, 0); //read data packet of 50
Please help me
Thanks
|