Advertisement

Revc & Send trubble

Started by January 05, 2003 05:52 PM
3 comments, last by logout 22 years, 1 month ago
Hm.. after a long long time with trying and failing i still cant get this ... thing to work. Recv() returns 0 Send() returns 50 (withs is the correct value for char buff[50] ) i looked the thing up in msdn and it said : "If the connection has been gracefully closed, the return value is zero." So is it the recv socket or the send socket that is closed ? /*I have used recv and send many times before but now i am trying to make a socket wrapper : and i cant find whats wrong */
quote:
So is it the recv socket or the send socket that is closed ?


recv() is telling you that the connection has been closed. Typically you use the same socket for sending and receiving.
Advertisement
Its to diffrent apps.
i am trying to send from
client A -> client B

A & B are on diffrent comps.

It means that connection has been closed. Which generally applies to both ends. Of course, if you never test the sending socket again, you''ll never know whether it''s been closed or not.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]
hm... inn the recv-part the code look like :

recv();recv();/* ofc i check the return value but thats not the point */ 


and i do
send();send(); 

in the send part.

Now : the recv resives the that sombody is trying to send but it cant get the data : it returns 0 ;

btw i am suing the "Connection Test" Chapter4 in Multiplayer Game Programin as the revc client. (with a bit of modefining )

The send part is my own.

Do anybody have a idea for how i can fix this, or what part of the code that is worng ?


This topic is closed to new replies.

Advertisement