server.cpp File Reference

Library for opening a TCP server, receiving data and sending message to monitor. More...

`#include "server.h"`
`#include <sys/socket.h>`
`#include <arpa/inet.h>`
`#include <netinet/in.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <unistd.h>`
Include dependency graph for server.cpp:

Go to the source code of this file.

## Macros

#define | NB_CONNECTION_MAX 1

## Functions

int | openServer (int port)
int | closeServer ()
int | acceptClient ()
int | sendDataToServer (char *data, int length)
int | sendDataToServerForClient (int client, char *data, int length)
int | receiveDataFromServer (char *data, int size)
int | receiveDataFromServerFromClient (int client, char *data, int size)

## Variables

int | socketFD = -1
int | clientID = -1

## Detailed Description

Library for opening a TCP server, receiving data and sending message to monitor.

Author
  PE.Hladik

Version
  1.0

Date
  06/06/2017

Definition in file server.cpp.

## Macro Definition Documentation

## NB_CONNECTION_MAX

#define NB_CONNECTION_MAX 1

Definition at line 35 of file server.cpp.

## Function Documentation

## acceptClient()

int acceptClient | ( |  | ) |

Definition at line 71 of file server.cpp.

## closeServer()

int closeServer | ( |  | ) |

Definition at line 63 of file server.cpp.

## openServer()

int openServer | ( | int | port | ) |

Definition at line 40 of file server.cpp.

## receiveDataFromServer()

int receiveDataFromServer | ( | char * | data,
|  | int | size
| ) |  |

Definition at line 95 of file server.cpp.

## receiveDataFromServerFromClient()

int receiveDataFromServerFromClient | ( | int | client,
|  | char * | data,
|  | int | size
| ) |  |

Definition at line 99 of file server.cpp.

## sendDataToServer()

int sendDataToServer | ( | char * | data,
|  | int | length
| ) |  |

Definition at line 85 of file server.cpp.

## sendDataToServerForClient()

int sendDataToServerForClient | ( | int | client,
|  | char * | data,
|  | int | length
| ) |  |

Definition at line 89 of file server.cpp.

## Variable Documentation

## clientID

int clientID = -1

Definition at line 38 of file server.cpp.

## socketFD

int socketFD = -1

Definition at line 37 of file server.cpp.