|
Bibliotheques TP RT
1.0
Bibliotheque de support pour TP/RT
|
Library for opening a TCP server, receiving data and sending message to monitor. More...
#include "image.h"
Go to the source code of this file.
Macros | |
| #define | DEFAULT_SERVER_PORT 2323 |
Functions | |
| int | openServer (int port) |
| Open server port, connect and listen to given port. More... | |
| int | closeServer () |
| Close server. More... | |
| int | acceptClient () |
| Wait for a client to connect. More... | |
| int | sendDataToServer (char *data, int length) |
| Send given data to monitor. More... | |
| int | sendDataToServerForClient (int client, char *data, int length) |
| Send given data to monitor, using specific client ID. More... | |
| int | receiveDataFromServer (char *data, int size) |
| Read data from monitor. More... | |
| int | receiveDataFromServerFromClient (int client, char *data, int size) |
| Read data from monitor, using specific client ID. More... | |
| int | sendImage (Jpg *image) |
| Send image to monitor using default client ID. More... | |
Library for opening a TCP server, receiving data and sending message to monitor.
Definition in file server.h.
| int acceptClient | ( | ) |
Wait for a client to connect.
| int closeServer | ( | ) |
Close server.
| int openServer | ( | int | port | ) |
Open server port, connect and listen to given port.
| port | A valid port number (1024 - 65535) |
| int receiveDataFromServer | ( | char * | data, |
| int | size | ||
| ) |
Read data from monitor.
Read, at most, size data from monitor. Data must be a valid pointer to a buffer large enough.
| data | A valid pointer to a buffer |
| size | Amount of data to read |
| int receiveDataFromServerFromClient | ( | int | client, |
| char * | data, | ||
| int | size | ||
| ) |
Read data from monitor, using specific client ID.
Read, at most, size data from monitor. Data must be a valid pointer to a buffer large enough.
| client | Client Id to receive from |
| data | A valid pointer to a buffer |
| size | Amount of data to read |
| int sendDataToServer | ( | char * | data, |
| int | length | ||
| ) |
Send given data to monitor.
Send given data to monitor using default client ID
| data | A valid pointer to a buffer |
| length | Amount of data to send |
| int sendDataToServerForClient | ( | int | client, |
| char * | data, | ||
| int | length | ||
| ) |
Send given data to monitor, using specific client ID.
Send given data to monitor using given client ID.
| client | Client Id to send data to |
| data | A valid pointer to a buffer |
| length | Amount of data to send |
| int sendImage | ( | Jpg * | image | ) |
Send image to monitor using default client ID.
Convert image to raw data, and add correct header before sending to monitor
| image | An image object after compression |