This codes below is for server c++ and client python. I am sending an image form client to server and server. When I send an image for server I found an image with 0 bytes. also, server gave this error ERROR reading from socket: Undefined error: 0
/* bind (this socket, local address, address length)
bind server socket (serverSock) to server address (serverAddr).
Necessary so that server can use a specific port */
/* Now bind the host address using bind() call.*/
if (bind(serverSock, (struct sockaddr *)&serverAddr, sizeof(sockaddr)) < 0)
{
perror("ERROR on binding");
exit(1);
}
/* Now start listening for the clients, here process will
* go in sleep mode and will wait for the incoming connection
*/
// wait for a client
/* listen (this socket, request queue length) */
listen(serverSock,5);