gcdasyncudpsocket

iOS devices not receiving UDP multicast using GDAsyncUdpSocket

為{幸葍}努か 提交于 2019-12-19 09:18:23
问题 The code below is intended to receive UDP multicast messages on 239.255.255.250 and simply NSLog the contents of the message. If I address a message to the IP of the iOS device (i.e. from a terminal echo foo | nc -u 10.1.10.249 1900 ) the message is received and NSLog'd. However, if I broadcast a message to the multicast address ( echo bar | nc -u 239.255.255.250 1900 ), the message is not received. No error messages are logged at start up. Thoughts on where I'm going awry? #import

UDP broadcast using GCDAsyncUdpSocket through all available Network Interfaces

自作多情 提交于 2019-12-10 10:54:29
问题 I am using GCDAsyncUdpSocket for broadcasting UDP packets for searching my NAS devices. Below is the code snippet for sending and receiving UDP packets NSString *broadCastAddress = @"255.255.255.255"; NSInteger udpPort = 8097; GCDAsyncUdpSocket *gcdAsyncUdpSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:selfdelegateQueue:dispatch_get_main_queue()]; [gcdAsyncUdpSocket bindToPort:udpPort error:&error]; [gcdAsyncUdpSocket setPreferIPv4]; NSData *data = @“Hi there”; // Sample data

UDP broadcast using GCDAsyncUdpSocket through all available Network Interfaces

北城以北 提交于 2019-12-06 10:23:10
I am using GCDAsyncUdpSocket for broadcasting UDP packets for searching my NAS devices. Below is the code snippet for sending and receiving UDP packets NSString *broadCastAddress = @"255.255.255.255"; NSInteger udpPort = 8097; GCDAsyncUdpSocket *gcdAsyncUdpSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:selfdelegateQueue:dispatch_get_main_queue()]; [gcdAsyncUdpSocket bindToPort:udpPort error:&error]; [gcdAsyncUdpSocket setPreferIPv4]; NSData *data = @“Hi there”; // Sample data [gcdAsyncUdpSocket enableBroadcast:YES error:&error]; [gcdAsyncUdpSocket beginReceiving:&error];

Swift: Receive UDP with GCDAsyncUdpSocket

我的未来我决定 提交于 2019-11-28 20:36:26
BACKGROUND: I want to be able to send and receive UDP packets between my iOS app and a server. The server echoes back every incoming message to the client the app. The server is tested and confirmed working . I have a StartViewController which starting up two classes that implements GCDAsyncUdpSocketDelegate, one for sending and one for receiving. The "sending socket" is working, the server receives the messages. PROBLEM: The app never get the incoming message back after it been sent. Something with the listening socket setup is probably wrong since didReceiveData never get called. Have I done

Swift: Receive UDP with GCDAsyncUdpSocket

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 13:00:02
问题 BACKGROUND: I want to be able to send and receive UDP packets between my iOS app and a server. The server echoes back every incoming message to the client the app. The server is tested and confirmed working . I have a StartViewController which starting up two classes that implements GCDAsyncUdpSocketDelegate, one for sending and one for receiving. The "sending socket" is working, the server receives the messages. PROBLEM: The app never get the incoming message back after it been sent.