I've just started running (what I thought was) a basic asyncsocket in my objective-c app and I'm getting the didAcceptNewSocket: message when connecting with telnet, but then I'm abruptly disconnected ("Connection closed by foreign ho开发者_Go百科st") without reaching the didConnectToHost: message. It works fine in the example and I've tried to replicate everything I see there to no avail.
Is there some simple pitfall I should be avoiding? Any other way I can debug this problem?
In this case, I was using the wrong delegate methods copied/pasted from some other site. Always check your headers!
精彩评论