Questions tagged [cocoaasyncsocket]

CocoaAsyncSocket is a TCP/IP socket networking library that wraps CFSocket and CFStream for Cocoa/Objective-C.

CocoaAsyncSocket is a TCP/IP socket networking library that wraps CFSocket and CFStream for Cocoa/Objective-C. More information at GitHub page

151 questions
5
votes
0 answers

CocoaAsyncSocket TCP proxy/tunnel

I'm using CocoaAsyncSocket trying to create a TCP-tunnel/mux/demux, forwarding all connections through a port pair (A <-> B). Everything written to port A should "come out" of port B and vice versa. I can use only ports A and B, can't open other…
Templar
  • 1,694
  • 1
  • 14
  • 32
5
votes
3 answers

Why GCDAsyncSocket connection is killed when device is locked, but not when press home button?

This happens on device and not on simulator. I opened my app and connected to server using GCDAsyncSocket. When I press home button, putting the app in background, and then switch back to the app, the socket still connects. No problem here. But if I…
Hlung
  • 13,850
  • 6
  • 71
  • 90
5
votes
1 answer

Why GCDAsyncSocket always disconnect afters read timeout?

I looked into GCDAsyncSocket.m at the code that handles read timeout. If I don't extend the timeout, it seems that socket got closed and there is no option to the socket alive keep. I can't use infinite timeout (timeout = -1) because I still need…
Hlung
  • 13,850
  • 6
  • 71
  • 90
5
votes
0 answers

GCDAsyncUdpSocket dropping packets and creating lots of DISPATCH_WORKER_THREADs

I'm building a multicast client with GCDAsyncUdpSocket and I'm facing a lot of packet loss. I have monitored the server with Wireshark as well as captured the WiFi packets in the air with AirCap, and I'm sure the packets are transmitted properly. I…
4
votes
0 answers

Best practices for keeping a persistent socket open to a server for IOS app

My app requires an open connection with a server for real-time updates. I need to be able to navigate through a number of views, during which I can send and receive data asynchronously. The goal is to have the app automatically update data in real…
nflacco
  • 4,972
  • 8
  • 45
  • 78
4
votes
1 answer

AsyncSocket TLS HOWTO

I am pretty new to AsyncSocket and I'm desperately trying to get it to connect to Facebook chat server (chat.facebook.com) on port 5222 (xmpp), and it does it very well. it used to work fine before facebook switched to secure sockets. Now the server…
Moshe Marciano
  • 2,349
  • 4
  • 33
  • 44
4
votes
1 answer

I am looking for some examples on GCDAsyncUdpSocket, but found none that works

didReceiveData was never called - I coded this swift class which was called by my mainline UIViewController to send out a message to the server which received it OK, but when the server sent a response back, the client never receives it because the…
stran
  • 41
  • 1
  • 2
4
votes
1 answer

Getting error library not found for -lCocoaAsyncSocket XCode 7.3 after Git push and clone

We have used pod to install Library. In one computer it is running fine. But when we pushed it into Git and cloned it, it's giving me this error : ld: library not found for -lCocoaAsyncSocket clang: error: linker command failed with exit code 1…
Shuvo Joseph
  • 894
  • 1
  • 12
  • 21
4
votes
1 answer

What's The Difference Between NSNetService and GCDAsynSocket?

On iOS, I'm using bonjour to find other devices so I can stream data between the two. I was planning to use NSNetService for bonjour, and CocoaAsyncSocket for streaming. In this example, they create a GCDAsyncSocket and a NSNetService on the same…
bendytree
  • 13,095
  • 11
  • 75
  • 91
4
votes
1 answer

How do I read data using CocoaAsyncSocket?

I have created a TCP Socket connection in my appDelegate didFinishLaunchingWithOptions method. That was the easy part, and I have successfully connected to my server. I am having great difficulty with reading the data from the server in my View. …
Skizz
  • 1,211
  • 5
  • 17
  • 28
3
votes
1 answer

Unable to connect in IPv6 network iOS GCDAsyncSocket

I have a game which uses socket based connections. It wrok well in an IPv4 network. We submitted an update to the App Store and it got rejected saying the game doesn't work under IPv6 networks. Our game backend is using AWS. When I gone through…
3
votes
1 answer

Implementing A UDP "Listener" In Swift?

I've been trying to somewhat reverse engineer a project to discover Logitech Harmony Hub devices on my network, and posted this question to see if someone could help me understand UDP broadcast. The answer explained that I've implementing the send…
ZbadhabitZ
  • 2,753
  • 1
  • 25
  • 45
3
votes
0 answers

Very high UDP packages loss on iOs (GCDAsyncUdpSockets)

I am working on an iPhone app for controlling physical hardware. The routine is as follows: app sends a specific 8-bytes "wake up" datagram on the broadcast channel, on port 8089; the message is repeatedly sent. external hardware, which is…
Davide
  • 31
  • 1
3
votes
3 answers

How to do multi-threading in iOS?

Sorry about the vague title of this question, I couldn't think of a concise sentence to explain the problem I'm having. Basically I want to start multiple threads and pass an object with thread-specific values that I can use within that context.…
3
votes
1 answer

How to fetch address from CocoaAsyncUDPSocket

Does anyone know how the delegate method for receiving UDP data in CocoaAsyncSockets work when it comes to fetching the source address? Specifically the method -(void)udpSocket:(GCDAsyncUdpSocket *)sock didReceiveData:(NSData *)data…
Rick
  • 3,240
  • 2
  • 29
  • 53
1
2
3
10 11