开发者

asyncsocket accepts socket but doesn't connect to host

开发者 https://www.devze.com 2023-04-09 13:17 出处:网络
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 disconnec

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!

0

精彩评论

暂无评论...
验证码 换一张
取 消