Claude Chappe' Curse - A C Game
Logo Institut d'Informatique Claude Chappe Logo Université de Le Mans Logo Raeptor Production
 
Loading...
Searching...
No Matches
client.h File Reference

Header file for socket client operations. More...

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

Go to the source code of this file.

Functions

int get_address (const char *name, int port, struct sockaddr_in *server_addr)
 Resolves the address of the server.
 
int connect_socket_server (const char *name, int port)
 Connects to a socket server.
 

Detailed Description

Header file for socket client operations.

Function Documentation

◆ get_address()

int get_address ( const char *  name,
int  port,
struct sockaddr_in *  server_addr 
)

Resolves the address of the server.

This function resolves the address of the server given its name and port number.

Parameters
nameThe name of the server.
portThe port number of the server.
server_addrA pointer to a sockaddr_in structure where the resolved address will be stored.
Returns
An integer indicating the success or failure of the address resolution. Returns 0 on success, or a negative value on failure.

◆ connect_socket_server()

int connect_socket_server ( const char *  name,
int  port 
)

Connects to a socket server.

This function establishes a connection to a socket server given its name and port number.

Parameters
nameThe name of the server.
portThe port number of the server.
Returns
An integer representing the socket file descriptor on success, or a negative value on failure.