CFSocketSetRemoteAddress, UDP sockets, and error handling
CFSocketSetRemoteAddress, UDP sockets, and error handling
- Subject: CFSocketSetRemoteAddress, UDP sockets, and error handling
- From: Andrew White <email@hidden>
- Date: Thu, 10 Feb 2005 22:58:21 +1100
Situation 1:
Create UDP CFSocket, connect (CFSocketConnectToAddress) to local machine,
port 7777.
Create UDP CFSocket, bind (CFSocketSetAddress) to INADDR_ANY, port 7777.
Packets can be sent from local to remote no problem.
Situation 2:
Create UDP CFSocket, connect to local machine, port 7777.
Attempt to send packets. Sending fails.
Now Create UDP CFSocket, bind (CFSocketSetAddress) to INADDR_ANY, port 7777.
Attempt to send packets. Send still fails.
Re-connect 1st socket to local machine, port 7777. Reports as successful.
However, send still fails, and attempt to CFSocketCopyPeerAddress reports
that there is no valid address on the interface. However, multiple
connects are explicitly legal on a UDP socket.
Create 3rd UDP CFSocket, connect to port 7777. Works.
Further notes:
To test, I tried various combinations of sending packets. As long as I
don't send to a port that doesn't exist, it works fine. Once I do so, that
socket never works properly again. What gives?
Any thoughts?
--
Andrew White
--------------------------------------------------------------------------
This email and any attachments are confidential. They may contain legally
privileged information or copyright material. You should not read, copy,
use or disclose them without authorisation. If you are not an intended
recipient, please contact us at once by return email and then delete both
messages. We do not accept liability in connection with computer virus,
data corruption, delay, interruption, unauthorised access or unauthorised
amendment. This notice should not be removed.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden