DistributedEmbeddedSystemsL.../04_intro_to_sockets/lib/sockets.h

23 lines
529 B
C

#ifndef SOCKETS_LIB_H
#define SOCKETS_LIB_H
// Function to create a TCP socket
int tcp_create_socket();
// Function to connect to a server
void connect_to_server(int sock, char *ip, int port);
// Function to communicate with the server
char* communicate(int sock, char *message);
// Function to create a TCP server socket
int tcp_listen(int port);
// Function to accept a client connection
int tcp_accept(int serv_sock);
// Function to process a client request
void process_request(int clnt_sock);
#endif // SOCKETS_LIB_H