#include "../include/utility.h"
#include "../include/cond_comp.h"
#include <netinet/in.h>
#include <string.h>
#include <stdio.h>
#include <string>
#include <arpa/inet.h>
Go to the source code of this file.
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 |
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
port | | port of the listening server | |
ip_addr | | IP address of the listening server |
Definition at line 42 of file utility.cpp.
References DEB.
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()
port | | port on which the server wants to wait for connection | |
ip_addr | | IP address on which the server wants to receive connections |
Definition at line 13 of file utility.cpp.
References BACKLOG, DEB, and listen().
Referenced by main().