问题
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