include/utility.h File Reference

#include <string>

Include dependency graph for utility.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define BACKLOG   30
 length of the backlog queue for the listening socket

Functions

int init_sd_serv (int port, string ip_addr)
 socket descriptor initializer function for servers
int init_sd_cli (int port, string ip_addr)
 socket descriptor initializer function for clients


Define Documentation

#define BACKLOG   30

length of the backlog queue for the listening socket

Definition at line 10 of file utility.h.

Referenced by init_sd_serv().


Function Documentation

int init_sd_cli ( int  port,
string  ip_addr 
)

socket descriptor initializer function for clients

this function initializes a socket and connects it with a listening server located at ip_addr:port. if this call is successful, the initialized socket is ready for data transfer

Parameters:
port | port of the listening server
ip_addr | IP address of the listening server
Returns:
-1 if failed (error printed), the sd value is successful

Definition at line 42 of file utility.cpp.

References DEB.

Referenced by main(), mode_1(), and mode_2().

int init_sd_serv ( int  port,
string  ip_addr 
)

socket descriptor initializer function for servers

this function initializes a socket using the port specified as an input parameter. it initializes the socket as a server should do. if this call is successful, the initialized socket is ready for accept()

Parameters:
port | port on which the server wants to wait for connection
ip_addr | IP address on which the server wants to receive connections
Returns:
-1 if failed (error printed), the sd value if successful

Definition at line 13 of file utility.cpp.

References BACKLOG, DEB, and listen().

Referenced by main().


Generated on Sat Jun 13 21:06:30 2009 for DistributedFileRepository by  doxygen 1.5.8