Questions tagged [gcdasyncsocket]

GCDAsyncSocket is a TCP socket library built upon Grand Central Dispatch. The project also contains a !RunLoop based version, as well as UDP socket libraries.

GCDAsyncSocket and AsyncSocket are TCP/IP socket networking libraries. Here are the key features available in both:

Native objective-c, fully self-contained in one class. No need to muck around with sockets or streams. This class handles everything for you. Full delegate support Errors, connections, read completions, write completions, progress, and disconnections all result in a call to your delegate method. Queued non-blocking reads and writes, with optional timeouts. You tell it what to read or write, and it handles everything for you. Queueing, buffering, and searching for termination sequences within the stream - all handled for you automatically. Automatic socket acceptance. Spin up a server socket, tell it to accept connections, and it will call you with new instances of itself for each connection. Support for TCP streams over IPv4 and IPv6. Automatically connect to IPv4 or IPv6 hosts. Automatically accept incoming connections over both IPv4 and IPv6 with a single instance of this class. No more worrying about multiple sockets. Support for TLS / SSL Secure your socket with ease using just a single method call. Available for both client and server sockets. GCDAsyncSocket is built atop Grand Central Dispatch:

Fully GCD based and Thread-Safe It runs entirely within its own GCD dispatch_queue, and is completely thread-safe. Further, the delegate methods are all invoked asynchronously onto a dispatch_queue of your choosing. This means parallel operation of your socket code, and your delegate/processing code. The Latest Technology & Performance Optimizations Internally the library takes advantage of technologies such as kqueue's to limit system calls and optimize buffer allocations. In other words, peak performance. AsyncSocket wraps CFSocket and CFStream:

Fully Run-loop based Use it on the main thread or a worker thread. It plugs into the NSRunLoop with configurable modes.

For more information follow these links:

  1. https://github.com/robbiehanson/CocoaAsyncSocket
  2. https://github.com/darkseed/cocoaasyncsocket/wiki/Reference_GCDAsyncSocket
204 questions
0
votes
1 answer

Reading response from GCDAsyncSocket on time (iOS)

This issue is pretty simple, I'm just having trouble figuring out how to handle it. I read data with: [asyncSocket readDataWithTimeout:-1 tag:2]; NSString *failure = [serverJSONResponseParsed objectForKey:@"failure"]; NSLog(@"Contents of string…
khaliq
  • 3,125
  • 4
  • 17
  • 23
0
votes
1 answer

Error trying to write data using GCDAsyncSocket on iOS 5.1

I'm trying to use GCDAsyncSocket in my iOS app. I've been following all the step provided in the CocoaAsyncSocket's wiki. Here is what I'm doing: GCDAsyncSocket socket = [[GCDAsyncSocket alloc] initWithDelegate:self…
adheus
  • 3,985
  • 2
  • 20
  • 33
0
votes
1 answer

CocoaAsyncSocket crashes when connecting

I have separated my networking code in a separate class IBStore. The code is very straightforward and based on the samples provided: #import #import "GCDAsyncSocket.h" @interface IBStore : UIViewController { GCDAsyncSocket…
AlexR
  • 5,514
  • 9
  • 75
  • 130
0
votes
1 answer

objective-c delegation

im new to iOS and objective-c, but im trying to use GCDAsyncSocket I'm using it to contact TCP/IP server for the whole application, in each viewController i want to start sending and receiving from/to server, so each time i alloc new instance of…
Omiga
  • 572
  • 3
  • 11
0
votes
2 answers

GCDAsyncSocket read data issue

I have a Cocoa live video program that uses GCDAsyncSocket as the network interface library. There is obvious sluggish when playing the video frames. For example, the time on the video goes almost twice as slow as normal. By inspecting the…
cs2k
  • 127
  • 9
-1
votes
1 answer

GCDAsyncSocket : android host can't get data written by iOS client

I am developing an iOs app which required to send and received message from Android Host app. Android host app create Wifi Hotpot programatically, iOS device will join it from setting. First, I tried with Apple's NSOutputStream class to write to…
girish_pro
  • 838
  • 9
  • 18
-1
votes
1 answer

How to find all the servers on local network?

I'm using CocoaAsyncSocket for a server client application on the iPad. Right now if the server is up the client can type in the IP of the server and connect to it. Is there a way to display all the servers on the local network that are running this…
Konrad Wright
  • 1,254
  • 11
  • 24
-1
votes
1 answer

GCDAsyncSockets, get answer

I'm trying to test a server connection with the GCDAsyncSocket. https://github.com/robbiehanson/CocoaAsyncSocket I want to connect to a ip + port and get a message, whether it worked, or not. I'm so far right now. - (BOOL)application:(UIApplication…
shizophren
  • 21
  • 7
-2
votes
1 answer

How do I hide GCDAsyncSocket warnings for 10.9 deprecations

10.9 deprecated a bunch of SSL stuff, how do I hide the warnings or fix the issues?
ssj
  • 881
  • 1
  • 10
  • 21
1 2 3
13
14