In AsyncSocket framework, how to do more than one Socket Connection in iPhone?

允我心安 提交于 2019-12-23 03:57:14

问题


I am now using AsyncSocket for iPhone socketing connection development. http://code.google.com/p/cocoaasyncsocket/

But I am having problem that, how to connect 2 multi-server to collect data from server?

I have host IP address A: 201.22.33.XXX.XX and host IP address B: 202.33.XXX.XX

I can success connect one server to collect data. But how to collect both server at the same time?

I tried create two socket objects with their own delegates, my path is like that:
step 1 ---- Connect to A step 2 ---- Connect to B Step 3 ---- Disconnect B but at this moment when i disconnect B, A also disconnected....

Please help.


回答1:


You'll need to create two socket objects with their own delegates. I have several applications that connect to multiple servers at once.



来源:https://stackoverflow.com/questions/8264484/in-asyncsocket-framework-how-to-do-more-than-one-socket-connection-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!