Hello again, the problem continous, in this moment i have achived accept the connection, then i have inserted in a select struct the three request socket .
When the customer send me a request i awake in select, but i can read anything, the program block in recv. The size of this reception is variable, in my first connection i ´must receive 10 bytes.
result = recv(s, BufferRx,sizeof(BufferRx), 0); //Block the program and i saw with wireshark that the message is full with 10 bytes
if (result<=0) //Error or close connection { CloseConnectionPC(aSocket,lSocket ); return; } nbytesRx+=result; //Byte received
//Calculate the Length. ¡¡¡¡¡ I supposed that 4 byte are received always TAKE CARE!!!!!!!
memcpy(&length_command, BufferRx, LENGHT_RX); if (length_command!=nbytesRx) { do{ result = recv(s, BufferRx+nbytesRx, length_command-nbytesRx, 0); if (result<=0) //Error or close connection
{ CloseConnectionPC(aSocket,lSocket ); return; } nbytesRx+=result;
} while (nbytesRx<length_command); } //All message is received memcpy(&code_command, BufferRx+LENGHT_RX,L_CODE_RX); //copy the code of message
switch(code_command) { ......
More thing, the size of buffer is 2048m but i want to use a buffer of 12000 bytes. If i write this size of buffer crack the application, and don´t create this task