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
1
vote
1 answer

set max packet size for GCDAsyncUdpSocket

I am using the GCDAsyncUdpSocket to send/receive data to a multicast group. In the GCDAsyncUdpSocket.m file, I found the setting bellow and changed the value to 32768 for example. But I can't still receive any packet that is larger than 9216…
user523234
  • 14,323
  • 10
  • 62
  • 102
1
vote
2 answers

Add run-time information to CocoaHTTPServer using custom Response class

I have the following code to start my own Cocoa HTTP Server. In order to manually handle the responses I have created my custom HTTPConnection class named PictureHTTPConnection self.httpServer = [[HTTPServer alloc]init]; self.httpServer.type =…
Besi
  • 22,579
  • 24
  • 131
  • 223
1
vote
1 answer

In AsyncSocket framework, how to do more than one Socket Connection in iPhone?

I am now using AsyncSocket for iPhone socketing connection development. http://code.google.com/p/cocoaasyncsocket/ But I am having problem that, how to connect 2 multi-server to collect data from server? I have host IP address A: 201.22.33.XXX.XX …
nullmicgo
  • 407
  • 4
  • 19
1
vote
1 answer

How to send a well-formed HTTP response in Cocoa sockets?

I'm making an app which includes a built in HTTP server. I need to send a PNG image over the socket, but somehow it's getting messed and the image just doesn't shows up. This is my code (I'm using AsyncSockets): if(processingURL == FALSE) { …
pmerino
  • 5,900
  • 11
  • 57
  • 76
1
vote
0 answers

How to adapt CocoaAsyncSocket package with async / await

Has anyone successfully adapted CocoaAsyncSocket (TCP and / or UDP) to support async / await? I’ve used CocoaAsyncSocket for the last few years in my apps and would like to simplify the apps by eliminating the delegate usage and replace it with…
DougPA
  • 85
  • 8
1
vote
0 answers

SSL/TSL using CocoaAsyncSockets and Java Sockets

I want to create a socket server in cocoa, using AsyncSockets and connect with Java. Enabling SSL works if Java is the server and cocoa the client, but I require the other way around to work. I guess I'm just missing some settings within cocoa, so…
Alx
  • 6,275
  • 7
  • 32
  • 54
1
vote
0 answers

CocoaAsyncSocket fallback for failed/unsupported commands

Although I am a rather "seasoned" developer, I've never actually needed to program sockets, apart from a perl project where I did both client and server, so everything was under my control. Hence, forgive me if I am going the wrong way and not doing…
Ecuador
  • 1,014
  • 9
  • 26
1
vote
2 answers

Cocoaasyncsocket problem, GCDAsyncSocket Connection problem

why when trying to connect when the server does not respond "try" shows that it is connected? I need to check the connection status. Every time, despite the timeout setting, it shows that it is connected ... My code: socket =…
prem111
  • 63
  • 1
  • 7
1
vote
0 answers

TCP Socket Connection Printing Blanks

I have a label printer, a Brady i3300, that I am connecting to from my iPad using a tcp socket (using the CocoaAsyncSocket framework). Each time I send data to the printer, it prints, but the label is always blank. Process First, I run…
Will Von Ullrich
  • 2,129
  • 2
  • 15
  • 42
1
vote
0 answers

CocoaAsyncSocket didRead is not called

I'm pretty new to socket programming and wanted to start with a simple TCP-Client Application. I tested it with several Test-Socket Apps. It always connects and sends the first message successfully, but it doesn't receive any messages. This is my…
1
vote
0 answers

Using SSL from Swift

I'm trying to connect to IRC via SSL using CocoaAsyncSocket and I seem to be going wrong somewhere. Here's the code I'm working with: func identity(named name: String, password: String) throws -> SecIdentity { let url =…
eskimo
  • 304
  • 1
  • 3
  • 15
1
vote
0 answers

Https server work on macOS but not work on iOS

I write a simple https server which only response "Hello world". The project use lib CocoaAsyncSocket to communicate. func socket(_ sock: GCDAsyncSocket, didAcceptNewSocket newSocket: GCDAsyncSocket) { let session = Session(socket: newSocket) …
Purkylin
  • 209
  • 2
  • 6
1
vote
0 answers

Send integer header along with json in socket programming using CocoaAsyncSocket

I want to send a header in the format [0xABCD,0F,0,0] along with the json {"cmd": 00} to a server using CocoaAsyncSocket library in swift. I can successfully send json string. It's the header part i don't know how to send. Please see the code I've…
sreejesh
  • 718
  • 5
  • 15
1
vote
1 answer

GCDAsyncUDPSocket get source address from structure using swift

I am using CocoaAsyncSocket to send and receive UDP packets. My code is working but I'm not sure how to get the address of the sender. The following function receives the packet and has a variable address but it's passed as Data. func udpSocket(_…
Jonathon Gardner
  • 473
  • 6
  • 12
1
vote
1 answer

Correct usage of PublishSubject with CocoaAsyncSocket

I'm creating simple messaging app based on CocoaAsyncSocket and STOMP protocol. So I created main class, which use PublishSubject, so the subscribers can observe incoming STOMP frames, something like this: class StompStream: NSObject { //MARK: -…
pavel_s
  • 465
  • 1
  • 7
  • 27