MIT Information Systems

Macintosh Development

[Home] [About Us] [People] [Information Systems]
[Kerberos for Macintosh] [Applications] [Miscellaneous Documentation]


Sockets Control Functions
OSStatus AbortSocketOperation (int sockFD);

AbortSocketOperation stops the current pending operation on the socket SockFD and closes the socket. This is how your application should implement command-. cancelling of socket operations. If there is no pending activity on the socket, AbortSocketOperation will just close the socket SockFD.

You should not call socket_close() on SockFD after calling this function.

OSStatus AbortAllDNSOperations (void);

AbortAllDNSOperations stops all current pending DNS operations. This currently includes all pending calls to gethostbyname(), gethostbyaddr(), gethostname() and gethostaddr(). Your application should use this implement command-. cancelling during a DNS query.

If there are no pending DNS operations, AbortAllDNSOperations will return without doing anything.

Boolean IsValidSocket (int sockFD);

IsValidSocket returns whether a given socket is still valid. The call exists because when a user changes settings in the TCP/IP control panel, the TCP/IP provider may be unloaded and reloaded, invalidating all your sockets. If you then try any socket calls, you will get an ENOTSOCK. If you wish to know whether a socket has been invalidated prior to any socket calls (say you're porting a UNIX library and don't want to rewrite it to handle ENOTSOCK in every socket call), then you can use IsValidSocket beforehand instead.


Questions or comments? Send mail to macdev@mit.edu
Last updated on $Date: 2003/11/19 20:49:16 $
Last modified by $Author: smcguire $