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
21
votes
2 answers

Not able to receive response of the sent UDP packets using GCDAsyncSocket

I am making an app to send UDP packets in order to switch on a LED bulb. I have been able to perform all the actions when I am connecting to the Ad-hoc created by the Wifi bridge. Now, I want to configure the Wifi bridge so that it can connect to…
Yuyutsu
  • 2,509
  • 22
  • 38
7
votes
1 answer

What to choose for data share in same wifi network: Multipeer, Bonjour, Socket connection

I am working on data share over same wifi two/more iOS devices.I have successfully implemented it using multipeer networking and explored it from videos documents.I am just looking on apple Dev for difference between Bonjour vs Multipeer Networking.…
maddy
  • 4,001
  • 8
  • 42
  • 65
7
votes
1 answer

Socket is disconnected immediately after making connection by using GCDAsyncSocket library in iPhone application

I want to read and write data from OBD2 Wifi enabled Adapter which is used to read car data and fault codes. For that ,I'm using GGCDAsyncSocket Library for socket connection. You can download CocoaAsyncSocket Library source code But it maintains…
NSS
  • 721
  • 1
  • 10
  • 23
7
votes
3 answers

GCDAsyncUdpSocket on iOS missing multicasted datagrams

I have a device on the network that is multicasting a very small file via UDP. The iOS app I am developing is responsible for reading these packets and I have chosen to use GCDAsyncUdpSocket to do so. The file is sent every half second, however I am…
Squatch
  • 1,027
  • 14
  • 27
6
votes
2 answers

Why might an EventMachine outbound data buffer stop sending and just fill up forever (while other connections can still send)

I have an EventMachine server sending TCP data down to a Mac client (via GCDAsyncSocket). It always works flawlessly for a while, but inevitably the server suddenly stops sending data on a connection-by-connection basis. The connection is still…
6
votes
1 answer

GCDAsynSocketDelegate didReadData method is not called. Using GCDAsynSocket

I am trying to simply send and recieve a message using GCDAsyncSocket and cannot get it to work. I am successfully establishing the connection and writing messages, but when it comes to reading my delegate is never called. I am im using ios5 and…
Cyprian
  • 9,423
  • 4
  • 39
  • 73
6
votes
2 answers

GCDAsyncSocket server receive data only first time

Client sent message every time when I press send button but Server receive message only first time. What is the issue in server Server: - (void)viewDidLoad { [super viewDidLoad]; asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self…
MD SHAHIDUL ISLAM
  • 14,325
  • 6
  • 82
  • 89
6
votes
1 answer

Asynchronous Values Update using GCDAsynSocket api

I am developing one application in which I need to update multiple values like Engine RPM,Speed etc. parameters at a time using OBD connector. I need to achieve asynchronous command/response . For this I am sending commands using [gcdAsyncSocket…
iCoder
  • 1,298
  • 1
  • 9
  • 25
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
2 answers

GCDAsyncSocket in Swift

I want to open a TCP connection with an OBD dongle based on ELM327 chip. So I have decided to use GCDAsyncSocket library. I wrote this code, import UIKit import CocoaAsyncSocket class ViewController: UIViewController, GCDAsyncSocketDelegate { …
5
votes
4 answers

Objective-C: eveluate server certificate signed by our own PKI (root CA) on TLS TCP connection

*solved* My problem is referencing to the following question: Objective-C: How to verify SecCertificateRef with signer's public key? We have an own PKI and so an own rootCA that we trust. With this rootCA we sign the certificates that are delivered…
geo
  • 1,781
  • 1
  • 18
  • 30
5
votes
1 answer

why GCDAsyncUdpSocket cannot send/receive packets after a while in broadcast mode?

I am using GCDAsyncUdpSocket to write a UDP socket in my app. The scenario is like this: when users click the button, it will send a broadcast packet in LAN then listen to the response, there is a server in LAN which will respond with one UDP…
chancyWu
  • 14,073
  • 11
  • 62
  • 81
5
votes
4 answers

Different result for [NSDate date] in several devices

To start, I have to say that I set autoset in date&time settings and time zone is the same for each device. So I use [NSDate date] to get time stamp in milliseconds, then encode to NSData and send to another device. On receiver data is being decoded…
Błażej
  • 3,617
  • 7
  • 35
  • 62
4
votes
0 answers

Client not playing from streaming data in iOS

Using Below code server start recording and start streaming to connected client and its working good. AudioServer.h #import #import #import "GCDAsyncSocket.h" #import…
Pratik Prajapati
  • 1,137
  • 1
  • 13
  • 26
4
votes
1 answer

GCDAsyncSocket for Synchronous Requests with Swift 1.2

Background: I'm using GCDAsyncSocket on a project successfully with Swift 1.2 (via a bridging header). The challenge right now is that it needs some sort of queue because the system it's connecting to can only process and return one command at a…
Mavro
  • 571
  • 8
  • 19
1
2 3
13 14