#include <SocketStream.h>
Inheritance diagram for FD::network_socket:
Public Member Functions | |
network_socket (int type, int port) | |
~network_socket () | |
Destructor, will terminate connexion calling shutdown(). | |
void | printOn (std::ostream &out) const |
void | init_broadcast () |
Init broadcast communication. | |
size_t | send_packet (unsigned char *packet, size_t size) |
size_t | recv_packet (unsigned char *packet, size_t size) |
void | shutdown () |
Shutdown network socket (will end communication). | |
void | socket_connect (const char *host) |
void | socket_listen (int backlog, bool blocking) |
void | socket_accept () |
int | get_type () |
int | get_port () |
int | get_read_socket () |
int | get_write_socket () |
int | get_listen_socket () |
Static Public Attributes | |
static const int | BROADCAST_TYPE |
Broadcast type on the subnet (mask = 255.255.255.0). | |
static const int | TCP_STREAM_TYPE |
TCP stream standard communication type. |
|
Constructor with type and port params.
|
|
Return the listen socket
|
|
Return the port of the socket.
|
|
Return the read socket
|
|
Returns the type of socket.
|
|
Return the write socket
|
|
Useful for IStream and OStream (deriving for Object) |
|
Read data from the network socket.
|
|
Send data on the network socket.
|
|
Accept from a socket (server), listen must have been done before. |
|
Connect to a host name.
|
|
Listen to a socket (server)
|