M
Manu
Hi,
Following code shows how a packet is sent from a client to a server's
socket. The file size (fileSizeTemp) is converted to network byte order
before sending to the server.
*((unsigned short *)&dataBuff[6 + filenameLen + 1]) = htons((unsigned
short)(fileSizeTemp >> 16));
*((unsigned short *)&dataBuff[6 + filenameLen + 3]) = htons((unsigned
short)((fileSizeTemp << 16) >> 16));
if (send(clientSock, ..., ...) == SOCKET_ERROR)
{
//...
}
My question is, how to get the size of the file (from the received packet)
on the server?
Thanks
Manu.
Following code shows how a packet is sent from a client to a server's
socket. The file size (fileSizeTemp) is converted to network byte order
before sending to the server.
*((unsigned short *)&dataBuff[6 + filenameLen + 1]) = htons((unsigned
short)(fileSizeTemp >> 16));
*((unsigned short *)&dataBuff[6 + filenameLen + 3]) = htons((unsigned
short)((fileSizeTemp << 16) >> 16));
if (send(clientSock, ..., ...) == SOCKET_ERROR)
{
//...
}
My question is, how to get the size of the file (from the received packet)
on the server?
Thanks
Manu.