gcdasyncsocket

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

巧了我就是萌 提交于 2019-12-18 13:31:26
问题 * 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

GCDAsyncUdpSocket on iOS missing multicasted datagrams

老子叫甜甜 提交于 2019-12-18 11:44:34
问题 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

Sending Multicast UDP by GCDAsyncUdpSocket fails, no activity in Wireshark

眉间皱痕 提交于 2019-12-11 08:11:23
问题 It works okay for any known IP like this: [udpSocket sendData:datatosend toHost:@"192.168.1.113" port:port withTimeout:-1 tag:0]; But when i'm trying to use broadband multicast, nothing logged and nothing goes on [udpSocket sendData:datatosend toHost:@"192.168.1.255" port:port withTimeout:-1 tag:0]; receiving works okay, i also tried 255.255.255.255 - the same. it doesn't give any error. 回答1: I found the solution: [udpSocket enableBroadcast:YES error:nil]; 来源: https://stackoverflow.com

GCDAsyncSocket “didReadDataWithTag” Never called with NSOperation subclass

最后都变了- 提交于 2019-12-11 03:28:32
问题 In a "getMyFile" method of some XIB file. I am creating a object of class "A"(subclass of NSOperation) and adding it to a "myFileQueue"(object of NSOperationQueue). myFileQueue.MaxConcurrentOperationCount = 1; Problem : didReadDataWithTag" delegate NEVER called in any case. #import "GCDAsyncSocket.h" //and all other required classes are imported correctly //Class : A @interface A : NSOperation { { GCDAsyncSocket* socket; dispatch_queue_t dQueue; BOOL isWorkDone; } } @implementation A { -main(

Different result for [NSDate date] in several devices

折月煮酒 提交于 2019-12-10 14:18:51
问题 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 and subtract with new [NSDate date] . So that I get total time needed for send and receive message. That I was thought because when sender is iPhone 4 iOS6 and receiver is iPhone 5 iOS7 then receiver have earlier time stamp than sender. I don't

GCDAsyncSocket read data issue

浪子不回头ぞ 提交于 2019-12-08 09:21:25
问题 I have a Cocoa live video program that uses GCDAsyncSocket as the network interface library. There is obvious sluggish when playing the video frames. For example, the time on the video goes almost twice as slow as normal. By inspecting the performance, I found that the GCDAsyncSocket's readDataToLength method is called too sparsely. Below is the log with time stamp: 2012-05-16 11:18:27.054 DVRLibDemo[1181:903] readDataToLength 2012-05-16 11:18:27.256 DVRLibDemo[1181:903] readDataToLength 2012

GCDAsyncSocket multiple connections wont accept data from multiple sockets

為{幸葍}努か 提交于 2019-12-07 16:23:39
问题 I am trying to write an app that connects to multiple sockets at the same time, i'm having trouble with receiving data from the old socket when a new one is connected. The main thing is the delegate is not activated by the previously connected socket. This is my overall program var struct = [serverlist]() //Create array for sockets and serverinfo func connect() { //Init socket struct[item].socket = GCDAsyncSocket(delegate: self, delegateQueue: dispatch_get_main_queue()) //Create error message

GCDAsyncUDPSocket source address returns null

隐身守侯 提交于 2019-12-06 07:57:42
google code question mirror: https://groups.google.com/forum/#!topic/cocoaasyncsocket/grhjZSMLr3U here is my code that is reading the response: - (void)init { udpSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; NSError *error = nil; if (![udpSocket bindToPort:UDP_PORT error:&error]) { //not connecting to host return; } if (![udpSocket beginReceiving:&error]) { return; } } - (void)udpSocket:(GCDAsyncUdpSocket *)sock didReceiveData:(NSData *)data fromAddress:(NSData *)address withFilterContext:(id)filterContext { NSString *msg = [[NSString alloc

How to set tcp_nodelay in GCDAsyncsocket?

我的未来我决定 提交于 2019-12-04 14:49:16
问题 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? 回答1: 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 =

GCDAsyncSocket in Swift

旧街凉风 提交于 2019-12-03 15:35:34
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 { let addr = "192.168.0.10" let port:UInt16 = 35000 var socket:GCDAsyncSocket! override func viewDidLoad() { super.viewDidLoad() socket = GCDAsyncSocket(delegate: self, delegateQueue: dispatch_get_main_queue()) do { try socket.connectToHost(addr, onPort: port) } catch let e { print(e) } // Do any additional setup after loading the view, typically from a nib