dear all:
I use AsyncUdpSocket for my iphone project:
and in implement follow method:
why don't run to NSLog(@"----------: 3") when the server broadcast message to 192.168.16.255.
thank you.
I use AsyncUdpSocket for my iphone project:
Code:
AsyncUdpSocket *udpSocket = [[AsyncUdpSocket alloc] initWithDelegate:self];
[udpSocket enableBroadcast:YES error:nil];
[udpSocket bindToPort:6000 error:nil];
[udpSocket receiveWithTimeout:-1 tag:0];
Code:
- (void)onUdpSocket:(AsyncUdpSocket *)sock didSendDataWithTag:(long)tag{
NSLog(@"----------: 1");
}
- (void)onUdpSocket:(AsyncUdpSocket *)sock didNotSendDataWithTag:(long)tag dueToError:(NSError *)error{
NSLog(@"----------: 2");
}
- (BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port{
NSLog(@"----------: 3");
}
- (void)onUdpSocket:(AsyncUdpSocket *)sock didNotReceiveDataWithTag:(long)tag dueToError:(NSError *)error{
NSLog(@"----------: 4");
}
- (void)onUdpSocketDidClose:(AsyncUdpSocket *)sock{
NSLog(@"----------: 5");
}
thank you.
Last edited: