gcdasyncsocket

How to set tcp_nodelay in GCDAsyncsocket?

。_饼干妹妹 提交于 2019-12-03 08:24:51
Seems like the title is self descriptive. I want to increase the speed of sending and receiving data in my app and i was told to set tcp_nodelay to true. But i have no idea how to do that with GCDAsyncSocket. Can anyone help me? I haven't used GCDAsyncSocket , but "GCDAsyncSocket.h" shows that you can get the underlying socket descriptor with the socketFD method, which must be called only in a performBlock: call. So the following code might work: [asyncSocket performBlock:^{ int fd = [asyncSocket socketFD]; int on = 1; if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char*)&on, sizeof(on)) == -1)

GCDAsyncSocket server receive data only first time

非 Y 不嫁゛ 提交于 2019-12-03 03:34:21
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 delegateQueue:dispatch_get_main_queue()]; NSError *err = nil; if (![asyncSocket acceptOnPort:10000 error:&err]){ NSLog(@"Error in acceptOnPort:error: -> %@", err); } } - (void)socket:(GCDAsyncSocket *)sock didAcceptNewSocket:(GCDAsyncSocket *)newSocket { NSLog(@"Accepted new socket from %@:%hu", [newSocket connectedHost], [newSocket connectedPort]); self

GCDAsyncUdpSocket immediately closes when sending to an IPv6 address

萝らか妹 提交于 2019-12-01 06:04:56
问题 I'm connecting via UDP to a server on a different device which is advertised by Bonjour. When both the iOS device which this code is running on, and the server, are on our wifi network it works just fine because the bonjour service resolves to a 192.168.0.xxx address which our dhcp server hands out. However when it is advertised by bluetooth, sometimes the service resolves to 169.254.xxx.xxx (IPv4) in which case it works just fine. But sometimes it resolves to fe80::xxxx:xxxx:xxxx:xxxx (IPv6)

SOCKS5 connection times out (GCDAsyncSocket). (OpenFire, XEP-0065 and iOS XMPPFramework)

故事扮演 提交于 2019-11-30 16:19:04
Problem : I am attempting a TURNSocket (XEP-0065 - SOCKS5) using the iOS XMPPFramework and an OpenFire Server. I want to be able to send and receive files. However, in most scenarios, the receiver returns no response. I currently suspect the problem is to do with the OpenFire proxy server, which times out! This is set up on the local network, and I have edited the hosts file to point to it. Note : The base of my code is from the following tutorial : http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/ XML and Error : The sender sends the following XML

Disconnecting with server immediately after connecting

僤鯓⒐⒋嵵緔 提交于 2019-11-30 16:00:42
I have written a Singleton Class using GCDAsyncsocket Library to establish connection with any other device having same service using Bonjour. On one device I am using its Method " startPublishing " to make it a Host(Server), from the Application on another Device(Client) I am calling " StartBrowsing " to find out the available Devices in Network. When user selects any of service in that Network I am calling method " initConnectionWithService ", that initiate Connection flow by resolving address of NetService to connect. BonjourUtilClass.h @interface BonjourUtilClass : NSObject

How to use GCDAsyncUdpSocket for multicast over wifi and bluetooth

我只是一个虾纸丫 提交于 2019-11-30 10:32:30
I am currently using GCDAsyncUdpSocket to send multicast datagrams over wifi between iOS devices. The Code is pretty simple.. Client self.socket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; //omitted error checking [self.socket bindToPort:12345 error:&err]; [self.socket joinMulticastGroup:@"224.0.1.1" error:&err]; [self.socket beginReceiving:&err]; Server self.multicastSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; NSData *d = [@"hello" dataUsingEncoding:NSUTF8StringEncoding]; [self

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

对着背影说爱祢 提交于 2019-11-30 10:01:57
* 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 to the personal servers. Now I want to connect with the iOS app and check if the cert that is delivered from the server is signed with our CA. My app should be able to connect to n servers with this certificates (maybe found with zero-conf service) using a TCP-connection, established by GCDAsyncSocket . I have the public part of the certificate in

GCDAsyncUdpSocket on iOS missing multicasted datagrams

我怕爱的太早我们不能终老 提交于 2019-11-30 04:03:18
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 not receiving it nearly that often (only receiving about every 3-10 seconds). Thinking that it may be an issue with the device, I began monitoring the traffic with Wireshark. This appeared to reflect what I was seeing in my app until I enabled "Monitor Mode" in Wireshark, at which point every UDP packet was being captured. In addition, the iOS

Disconnecting with server immediately after connecting

梦想的初衷 提交于 2019-11-29 22:31:47
问题 I have written a Singleton Class using GCDAsyncsocket Library to establish connection with any other device having same service using Bonjour. On one device I am using its Method " startPublishing " to make it a Host(Server), from the Application on another Device(Client) I am calling " StartBrowsing " to find out the available Devices in Network. When user selects any of service in that Network I am calling method " initConnectionWithService ", that initiate Connection flow by resolving