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

Read whole html string Asyncsocket iOS

Hi I want to read from a server the whole html not only the request like "HTTP/1.1 200 OK" I mean the html code too. But I dont know how. I am using the Asyncsocket library from "https://github.com/roustem/AsyncSocket" have someone an idea how can…
0
votes
1 answer

CocoaAsyncSocket not behaving as expected when building console application

I'm trying to write a simple client that should connect to a server with TCP using CocoaAsyncSocket. I have a class, MyClass that is set as the delegate to CocoaAsyncSocket and when building a "Cococa Application" (with UI) this class works as it…
norq
  • 1,404
  • 2
  • 18
  • 35
0
votes
2 answers

CocoaAsyncSocket / GCDAsyncSocket add a delay between writes on the queue

I have the following function: if (socket==nil) socket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; if (elBuffer==nil) elBuffer = [[NSMutableData alloc] init]; } if ([socket isDisconnected]) { …
JoeGalind
  • 3,545
  • 2
  • 29
  • 33
0
votes
1 answer

AsyncSocket delegate not invoked

I'm trying to write an app to send/receive data by means of the CocoaAsyncSocket library. In the first version of the App, the socket is created/initialized in the View Controller where I also put the delegate methods that are correctly…
Corrado
  • 505
  • 1
  • 5
  • 18
0
votes
1 answer

Read unknown number of incoming bytes

My app communicates with a server over TCP, using AsyncSocket. There are two situations in which communication takes place: The app sends the server something, the server responds. The app needs to read this response and do something with the…
Scott Berrevoets
  • 16,921
  • 6
  • 59
  • 80
0
votes
1 answer

AsyncSocket delegate method not called

I retain a socket in a singleton class like following: SocketConnection.h @interface SocketConnection : NSObject + (GCDAsyncSocket *) getInstance; @end SocketConnection.m #define LOCAL_CONNECTION 1 #if LOCAL_CONNECTION #define HOST…
goofansu
  • 2,277
  • 3
  • 30
  • 48
0
votes
1 answer

AsyncSocket howto construct prefix with N bytes indicating the length of packet?

I'm new to iOS socket programming. I've implemented a tcp server with erlang with {packet, 4}, it is easy to communicate between erlang sockets. But how can I prepend packet's length in 4 bytes in AsyncSocket? Some codes is appreciated. I tested…
goofansu
  • 2,277
  • 3
  • 30
  • 48
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
2 answers

Application Freezing when calling CocoaAsyncMethod scheduleDequeueRead

I'm using CocoaAsyncSocket library to create a TCP socket connection. The problem I'm having is after a few library methods are called, I'm getting an error. appDelegate: - (BOOL)application:(UIApplication *)application…
Skizz
  • 1,211
  • 5
  • 17
  • 28
0
votes
1 answer

CocoaAsyncSockets seems to be failing when calling onSocket:didReadData:withTag

for some reason when I try to call CocoaAsyncSocket's onSocket:didReadData:withTag method, it's failing and not showing data from the read. appDelegate: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary…
Skizz
  • 1,211
  • 5
  • 17
  • 28
0
votes
1 answer

Reading Data using CocoaAsyncSocket returns blanks

I have created a TCP Sockets connection using CocoaAsyncSocket and whenever I try to perform didReadData, I'm getting back blanks. I found the value of "msg" was @"" when I set break points and tried to debug. This is what my appDelegate.m looks…
Skizz
  • 1,211
  • 5
  • 17
  • 28
0
votes
1 answer

CocoaAsyncSockets creating Connection on app startup but Reading/Writing from a view(s)

I am using the CocoaAsyncSockets library in order to create a tcp socket connection in my app. Currently, I have successfully created a connection by opening the socket connection in my didFinishLaunchingWithOptions method in my appDelegate.m file.…
Skizz
  • 1,211
  • 5
  • 17
  • 28
0
votes
1 answer

Asyncsocket: no local or remote addresses

I'm trying to set up a TCP connection to a local server, and since pretty much everyone agrees that Asyncsocket is the way to go, I went for it, too. However, I'm running into problems at the most basic level: the Asyncsocket instance doesn't have a…
Scott Berrevoets
  • 16,921
  • 6
  • 59
  • 80
0
votes
1 answer

Cocos2d and CocoaAsyncSocket

Please help me fix this problem : 1 - I create a Cocos2d project, add CFNetwork.framework. 2 - I add GCDAsyncUdpSocket.h and GCDAsyncUdpSocket.m from CocoaAsyncSocket library to my project 3 - Built. ---> I have 201 error????? .(although I dont do…
0
votes
1 answer

CocoaAsyncTask can't connect real device

I'm using CocoaAsyncTask and trying to connect to the localhost. When I run it from the simulator, it works (I'm checking it with the provided echo server) but when I run it on the actual device, nothing happens.. the code is: if(![socket…
La bla bla
  • 8,558
  • 13
  • 60
  • 109
1 2 3
10
11