C socket programming: recv / select not seeing sent messages

Posted by Fantastic Fourier on Stack Overflow See other posts from Stack Overflow or by Fantastic Fourier
Published on 2010-05-23T16:36:45Z Indexed on 2010/05/23 16:41 UTC
Read the original article Hit count: 235

Filed under:
|
|

Hey guys, I had some questions, about socket programming for client-server using TCP/IP. I am using select() to recv(), which works fine when client send() messages to server, but not the other way around. The send() returns positive (and reasonable) numbers of bytes sent by server but I know that the nubmer of bytes "sent" really means "sent out of the socket", not "sent and was received by the client." The select() function seems to work fine. So given that, my guess is that it's the send() function that is giving me the problem. Probably the address of client in send() is not correct. But when I compared address.sin_addr.s_addrmember (it's an unsigned long int) of struct sockaddr_in from recv() and send() of server, they are identical. So I am kind of lost as to what could be wrong?

© Stack Overflow or respective owner

Related posts about c

    Related posts about sockets