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

CocoaAsyncSocket and True iOS Peer-to-Peer file transfer through NSNetService's includePeerToPeer setting

I'm trying to create an application that has the ability to transfer large files between iOS devices through what I'll call a "true" peer-to-peer network ie two devices connected directly to each other without an intermediate router / wi-fi network.…
user3062913
  • 353
  • 2
  • 10
2
votes
1 answer

Swift - Incorrect argument label in call with bindToPort

I'm trying to use CocoaAsyncSocket library with Swift. I would like to implement a UDP server and client. I've imported the library and here is one of my methods's implementation: func setupConnection(){ var error : NSError? socket =…
Jojo56400
  • 309
  • 3
  • 12
2
votes
1 answer

Swift 2: Binary operator '==' cannot be applied to operands of type '()?' and 'Bool'

After I updated Xcode 7 beta and convert my swift code to Swift 2, I got these two errors that I can't figure out.. Call can throw, but it is not marked with 'try' and the error is not handled Binary operator '==' cannot be applied to operands of…
Shoun Moon
  • 23
  • 3
2
votes
1 answer

TCP Client in iOS/Objective-C - Checking for Open Port

I've dug around on a few questions on SO about AsyncSocket, but nothing's clicked. I feel what I'm trying to do is fairly simple, so it'll be face-palm... I have tried the non-GCD version, but no joy there either. I need to be able to scan a range…
voodoobilly
  • 405
  • 7
  • 18
2
votes
1 answer

Creating sockaddr_in for CocoaAsyncSocket Getting Invalid IPv4 address

I'm having trouble connecting to a Java socket server. I know the server is working because I connect via a Java socket. I'm using the CocoaAsyncSocket library to make a client connection from an iOS device. I've tried the following, [socket…
anders
  • 4,168
  • 2
  • 23
  • 31
2
votes
1 answer

How to read variable length data from an asynchronous tcp socket?

I'm using CocoaAsyncSocket for an iOS project. I'm trying to read VarInts through an asynchronous interface. The problem is unlike something else like a String, where I can prefix a length, I don't know the length of a varint beforehand. It needs to…
Raekye
  • 5,081
  • 8
  • 49
  • 74
2
votes
0 answers

CocaAsyncSocket losing UDP packets, Possible iOS 7/iPad issue?

I am currently on XCode 5.0 and working on an iOS 7 sample application which uses CocoaAyncSocket library. In this application, the "sender controller" sends UDP messages on 255.255.255.255 on port 4000 for a "receiver controller" to handle and…
mrcolombo
  • 587
  • 4
  • 19
2
votes
1 answer

GCDAsyncSocket connect fails -- only when socket variable is called "socket". What is happening?

I'm having an issue that is more bemusing to me than anything. I'm trying to establish a socket connection in Objective-C using GCDAsyncSocket. My connectToHost message sent to my GCDAsyncSocket fails with an EXC_BAD_ACCESS if and only if the socket…
ekl
  • 1,052
  • 2
  • 9
  • 24
2
votes
2 answers

Synchronous communication using GCDAsyncSocket

I am using GCDAsyncSocket (CocoaAsyncSocket) for the socket communication in my app. Due to the asynchronous nature of GCDAsyncSocket, my network request (submitMessage below) is decoupled from the callback block that runs when data is received…
2
votes
1 answer

SSL/TLS server running on an iOS device

It is possible to build an SSL/TLS server which is running on an iOS device? If yes, how? My doubts are related to these questions: On the device, can I create on the fly a self-signed certificate to be used from then on? Or can I tell SSL/TLS not…
Dev
  • 7,027
  • 6
  • 37
  • 65
2
votes
1 answer

Issue Connecting with GCDAsyncSocket with OSX executable

I have the excellent GCDAsyncSocket running perfectly on an iOS app I have developed. I was just playing around with setting up a Mac OSX command line program that uses the library in a similar way to log to SQLite DB but can't get it to even…
Andy
  • 717
  • 1
  • 9
  • 24
2
votes
1 answer

Reading complex socket responses

I have a code design question, I'm having trouble thinking of the most efficient manner to handle this: Basically, I want to send a JSON request and read the response back from the server in one go. I have a methods such…
khaliq
  • 3,125
  • 4
  • 17
  • 23
2
votes
1 answer

GCDAsyncSocket for iOS is not writing out the buffer

Basically I write an NSData object: [asyncSocket writeData:JSONRequestData withTimeout:-1 tag:1]; Which when run, invokes the delegate - (void)socket:(GCDAsyncSocket *)sock didWriteDataWithTag:(long)tag But for some reason, when the write goes to…
khaliq
  • 3,125
  • 4
  • 17
  • 23
2
votes
1 answer

GCDasyncUdpSocket and wifi Interface

en0 seems to be the wifi interface for Apple iOS devices, but in my code, small multicast client when I specify the interface en0 I'm not receiving anything. Any clue of what could be wrong ? GDCasyncUdpSocket logs don't show any error => Binding…
tony590
  • 145
  • 2
  • 11
2
votes
0 answers

GCDAsyncUdpSocket UDP communication over internet

I have a problem using GCDAsyncUdpSocket over internet. Everything works fine when I am doing test on my local computer. I try to to send UDP message between a computer connected to internet with a 3G key and an Ipod connected through wifi.…