#include "commands.h"
#include "utils.h"
Go to the source code of this file.
- Author
- yaishenka
- Date
- 25.04.2021
Definition in file net_utils.h.
void close_connection |
( |
int |
sockd | ) |
|
Close connection
- Parameters
-
Definition at line 60 of file net_utils.c.
int make_connection |
( |
const char * |
address | ) |
|
Establish connection with address
- Parameters
-
- Returns
- socket
Definition at line 27 of file net_utils.c.
void parse_address |
( |
const char * |
address, |
|
|
char ** |
host, |
|
|
long * |
port |
|
) |
| |
Split address to port and host
- Parameters
-
- Author
- yaishenka
- Date
- 25.04.2021
Definition at line 11 of file net_utils.c.
bool receive_command |
( |
int |
sockd, |
|
|
enum Command * |
command |
|
) |
| |
Receive command from fd
- Parameters
-
- Returns
- true if all ok and false otherwise
Definition at line 84 of file net_utils.c.
bool receive_data |
( |
int |
sockd, |
|
|
char ** |
data, |
|
|
size_t * |
size |
|
) |
| |
Receive data from socket. Write data to data and size to size
- Parameters
-
- Returns
- true if all ok and false otherwise
Definition at line 94 of file net_utils.c.
bool send_command |
( |
int |
sockd, |
|
|
enum Command |
command |
|
) |
| |
Send command from Command enum to socket
- Parameters
-
Definition at line 64 of file net_utils.c.
bool send_data |
( |
int |
sockd, |
|
|
char * |
data, |
|
|
size_t |
size |
|
) |
| |
Send data to socket
- Parameters
-
Definition at line 75 of file net_utils.c.