Hi,
So I'm creating an input socket using
CFSocketCreateWithSocketSignature (NULL, &signature, kCFSocketDataCallBack, receiveData, &socket_context);
Within the receiveData function (that gets called properly) I'm trying to use the CFDataRef address
parameter to find out the sender address of the this "package".
The IP address of the sender PC is at 192.168.1.2.
I'm using
char buffer[INET_ADDRSTRLEN];
NSLog([NSString stringWithFormat:@"incoming connection from: %s", inet_ntop(AF_INET, address, buffer, INET_ADDRSTRLEN)]);
However I always get the 192.6.105.48 out of the log. What gives? I'm really not big on networking in Cocoa/C so any help / explanation is very much appreciated.
Thanks in advance!