Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Gandolfmatt

macrumors member
Original poster
Jul 18, 2008
46
0
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:
Code:
//[sock writeData:data withTimeout:-1 tag:ECHO_MSG];
Then it'll work perfectly though I don't think I want to have to continually send messages to receive them.
 

Attachments

  • EchoServer.zip
    213.4 KB · Views: 110
  • Mac Client.zip
    27 KB · Views: 163
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.