I'm using the Echo Server from the Cocoa Async Socket wiki and I've built my own client to connect and send messages back and forth.
Now my problem is that it appears that the Echo Server must send a message back to the client in order for it to receive messages.
Is this a bug or is it meant to be that way?
Thanks,
-Gan
P.S. The server and client are connected below if you want to try them. Just open the server, type in 7777 as the port, hit start, open the client and it'll automatically connect. Then watch the server and the client's debug text printed in Xcode. As you'll see, the server receives only one message. Now if you go the the server's code and uncomment this line:
Then it'll work perfectly though I don't think I want to have to continually send messages to receive them.
Now my problem is that it appears that the Echo Server must send a message back to the client in order for it to receive messages.
Is this a bug or is it meant to be that way?
Thanks,
-Gan
P.S. The server and client are connected below if you want to try them. Just open the server, type in 7777 as the port, hit start, open the client and it'll automatically connect. Then watch the server and the client's debug text printed in Xcode. As you'll see, the server receives only one message. Now if you go the the server's code and uncomment this line:
Code:
//[sock writeData:data withTimeout:-1 tag:ECHO_MSG];