#include <PracticalSocket.h>
Inheritance diagram for Socket:

Public Member Functions | |
| ~Socket () | |
| string | getLocalAddress () throw (SocketException) |
| unsigned short | getLocalPort () throw (SocketException) |
| void | setLocalPort (unsigned short localPort) throw (SocketException) |
| void | setLocalAddressAndPort (const string &localAddress, unsigned short localPort=0) throw (SocketException) |
| ~Socket () | |
| string | getLocalAddress () throw (SocketException) |
| unsigned short | getLocalPort () throw (SocketException) |
| void | setLocalPort (unsigned short localPort) throw (SocketException) |
| void | setLocalAddressAndPort (const string &localAddress, unsigned short localPort=0) throw (SocketException) |
Static Public Member Functions | |
| static void | cleanUp () throw (SocketException) |
| static unsigned short | resolveService (const string &service, const string &protocol="tcp") |
| static void | cleanUp () throw (SocketException) |
| static unsigned short | resolveService (const string &service, const string &protocol="tcp") |
Protected Member Functions | |
| Socket (int type, int protocol) throw (SocketException) | |
| Socket (int sockDesc) | |
| Socket (int type, int protocol) throw (SocketException) | |
| Socket (int sockDesc) | |
Protected Attributes | |
| int | sockDesc |
Private Member Functions | |
| Socket (const Socket &sock) | |
| void | operator= (const Socket &sock) |
| Socket (const Socket &sock) | |
| void | operator= (const Socket &sock) |
|
|
Close and deallocate this socket |
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
Close and deallocate this socket |
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
Get the local address
|
|
|
Get the local port
|
|
|
Set the local port to the specified port and the local address to any interface
|
|
||||||||||||
|
Set the local port to the specified port and the local address to the specified address. If you omit the port, a random port will be selected.
|
|
|
If WinSock, unload the WinSock DLLs; otherwise do nothing. We ignore this in our sample client code but include it in the library for completeness. If you are running on Windows and you are concerned about DLL resource consumption, call this after you are done with all Socket instances. If you execute this on Windows while some instance of Socket exists, you are toast. For portability of client code, this is an empty function on non-Windows platforms so you can always include it.
|
|
||||||||||||
|
Resolve the specified service for the specified protocol to the corresponding port number in host byte order
|
|
|
|
|
|
Get the local address
|
|
|
Get the local port
|
|
|
Set the local port to the specified port and the local address to any interface
|
|
||||||||||||
|
Set the local port to the specified port and the local address to the specified address. If you omit the port, a random port will be selected.
|
|
|
If WinSock, unload the WinSock DLLs; otherwise do nothing. We ignore this in our sample client code but include it in the library for completeness. If you are running on Windows and you are concerned about DLL resource consumption, call this after you are done with all Socket instances. If you execute this on Windows while some instance of Socket exists, you are toast. For portability of client code, this is an empty function on non-Windows platforms so you can always include it.
|
|
||||||||||||
|
Resolve the specified service for the specified protocol to the corresponding port number in host byte order
|
|
|
|
|
|
|
1.4.5-20051010