SimGrid  3.8.1
Scalable Simulation of Distributed Systems - Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Socket creation functions

Functions

xbt_socket_t gras_socket_client (const char *host, unsigned short port)
 Simply create a client socket (to speak to a remote host)
xbt_socket_t gras_socket_client_from_string (const char *host)
 Opens a client socket to a remote host specified as 'host:port'.
xbt_socket_t gras_socket_server (unsigned short port)
 Simply create a server socket (to ear from remote hosts speaking to you)
void gras_socket_close (xbt_socket_t sd)
 Close socket.
xbt_socket_t gras_socket_client_ext (const char *host, unsigned short port, unsigned long int bufSize, int measurement)
 Create a client socket, full interface to all relevant settings.
xbt_socket_t gras_socket_server_ext (unsigned short port, unsigned long int bufSize, int measurement)
 Create a server socket, full interface to all relevant settings.
xbt_socket_t gras_socket_server_range (unsigned short minport, unsigned short maxport, unsigned long int buf_size, int measurement)
 Opens a server socket on any port in the given range.

Detailed Description

Function Documentation

xbt_socket_t gras_socket_server ( unsigned short  port)

Simply create a server socket (to ear from remote hosts speaking to you)

Simply create a server socket (to ear from remote hosts speaking to you)

In real life, you'll get a TCP socket.

xbt_socket_t gras_socket_client_ext ( const char *  host,
unsigned short  port,
unsigned long int  buf_size,
int  measurement 
)

Create a client socket, full interface to all relevant settings.

Create a client socket, full interface to all relevant settings.

Parameters
host,:who you want to connect to
port,:where you want to connect to on this host
buf_size,:size of the buffer (in bytes) on the socket (for TCP sockets only). If 0, a sain default is used (32k, but may change)
measurement,:whether this socket is meant to convey measurement (if you don't know, use 0 to exchange regular messages)

In real life, you'll get a TCP socket.

xbt_socket_t gras_socket_server_ext ( unsigned short  port,
unsigned long int  buf_size,
int  measurement 
)

Create a server socket, full interface to all relevant settings.

Create a server socket, full interface to all relevant settings.

Parameters
port,:port on which you want to listen
buf_size,:size of the buffer (in byte) on the socket (for TCP sockets only). If 0, a sain default is used (32k, but may change)
measurement,:whether this socket is meant to convey measurement (if you don't know, use 0 to exchange regular messages)

In real life, you'll get a TCP socket.

xbt_socket_t gras_socket_server_range ( unsigned short  minport,
unsigned short  maxport,
unsigned long int  buf_size,
int  measurement 
)

Opens a server socket on any port in the given range.

Parameters
minport,:first port we will try
maxport,:last port we will try
buf_size,:size of the buffer (in byte) on the socket (for TCP sockets only). If 0, a sain default is used (32k, but may change)
measurement,:whether this socket is meant to convey measurement (if you don't know, use 0 to exchange regular messages)

If none of the provided ports works, raises the exception got when trying the last possibility