#include <raw_socket.hh>

Public Member Functions | |
| raw_socket * | accept (void) |
| Accept a connection request. | |
| sock_err | bind (const std::string &port) |
| Bind socket to a local address. | |
| sock_err | close (void) |
| Close the socket. | |
| sock_err | connect (const std::string &peer) |
| connect to specied peer. | |
| sock_err | listen (const std::string &port, int lq) |
| Listen for connection requests. | |
| virtual long | read_available (char *buf, long len) |
| Read available data. | |
| virtual int | socket_id (void) const |
| Get the socket id. | |
| int | wait_data (double nsec) |
| Wait for data. | |
| virtual long | write (const char *buf, long len) |
| Write data. | |
Protected Member Functions | |
| raw_socket (int fd) | |
| construct a socket | |
Protected Attributes | |
| int | mSocket |
The default socket api stuff.
| sends::raw_socket::raw_socket | ( | int | fd | ) | [protected] |
construct a socket
Construct a raw_socket from an existing unix socket.
| fd | File descriptor for existing socket. |
| raw_socket* sends::raw_socket::accept | ( | void | ) | [virtual] |
Accept a connection request.
Accept creates a new socket connected to the first external socket requesting a connection.
Implements sends::socket_api.
| sock_err sends::raw_socket::bind | ( | const std::string & | addr | ) | [virtual] |
Bind socket to a local address.
Bind the socket to a local address. If the IP address is zero the socket will be bound to all local networks. If the port number is zero or omitted, the next available port is allocated.
| addr | Local addres to which the socet is to be bound. |
Implements sends::socket_api.
| sock_err sends::raw_socket::close | ( | void | ) | [virtual] |
Close the socket.
Abstract method to close the socket. This method will depend strongly on the implementation.
Implements sends::socket_api.
| sock_err sends::raw_socket::connect | ( | const std::string & | s | ) | [virtual] |
connect to specied peer.
Connect to the specified address.
| s | Peer socket address |
Implements sends::socket_api.
| sock_err sends::raw_socket::listen | ( | const std::string & | port, | |
| int | lq | |||
| ) | [virtual] |
Listen for connection requests.
Listen to the specified port address, Queue the specified number of connection requests pending acceptance.
| port | Local port name to listen to. | |
| lq | Length of connection request queue |
Implements sends::socket_api.
| virtual long sends::raw_socket::read_available | ( | char * | buf, | |
| long | len | |||
| ) | [virtual] |
Read available data.
Read up to the specified number of bytes from the socket into the buffer.
| buf | Pointer to buffer to receive data. | |
| len | Maximum length of data to be read (in bytes). |
Implements sends::socket_api.
| int sends::raw_socket::socket_id | ( | void | ) | const [inline, virtual] |
Get the socket id.
Get a socket id number. In general this will be the system fd for the socket.
Implements sends::socket_api.
| int sends::raw_socket::wait_data | ( | double | nsec | ) | [virtual] |
Wait for data.
Wait at most the specified number of seconds for data to arrive for reading.
| nsec | Maximum number of seconds to wait for data |
Reimplemented from sends::socket_api.
| virtual long sends::raw_socket::write | ( | const char * | buf, | |
| long | len | |||
| ) | [virtual] |
Write data.
Write the specified number of bytes into the buffer.
| buf | Pointer to data to be written | |
| len | Length of data to be written (in bytes). |
Implements sends::socket_api.
1.5.5