I am trying to implement basic messaging between two devices by specifying IP addresses. When one device tells the listening socket to listen to the following:
UInt16 port = 59647;
NSError *err = nil;
[socket acceptOnPort:port error:&err];
The delegate didAcceptNewSocketis called correctly and should return a new socket to the connecting IP: Port. However, as far as I can tell about this, a new socket should then be called didConnectToHost, which, as far as I can tell, this is not so.
didConnectToHost runs correctly, because the device that initiates the connection to its socket correctly calls it after the connection is established.
I do nothing in didAcceptNewSocketbut a few NSLogsand set the old socket to listen to in a new one (since it is not needed after, and binding to another variable before it has changed nothing, and should not).
What can my new socket on the listening side do not call this delegate?
source
share