Both, GCDAsyncSocket and AsyncSocket titles state they are asynchronous, both look similar. However, all stuff about sockets is about handling a single continuous stream of unlimited length, coming from TCP data packets. At first, I was a little bit confused, thought AsyncSocket does some magic by making custom request and response packets and handling them for me asynchronously (for example if I make request A,B,C then a response from a server might come in a different order, for example B,C,A). After a bit of digging into the world of sockets, I understood the data coming both from a server (via socket reads) is verrry synchronous, not asynchronous. It’s all about reading one stream, cutting it into the packets and making callbacks to my delegate class, and if I make requests A,B,C then responses from a server will come in the same order A,B,C. AFAIK, AsyncSocket uses main run loop, so it’s again using main thread, main queue. So, what its part is about being asynchronous?
Both, GCDAsyncSocket and AsyncSocket titles state they are asynchronous, both look similar. However, all
Share
It is asynchronous in the sense that read and write calls return immediately, without blocking the thread, and allow you to process their results at a later time via delegation and/or blocks.