In AsyncSocket environment, how to make multiple Socket connections in iPhone?

Now I am using AsyncSocket to develop socket for iPhone. http://code.google.com/p/cocoaasyncsocket/

But I have a problem: how to connect 2 multiservers to collect data from the server?

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

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

I tried to create two socket objects with my own delegates, my path is as follows:
Step 1 ---- Connect to A Step 2 ---- Connect to B Step 3 ---- Disconnect B but at this moment when I disconnect B, A also disconnects ....

Please, help.

+1
source share
1 answer

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

+1
source

Source: https://habr.com/ru/post/1396977/


All Articles