server.h
Go to the documentation of this file.
/*
* Copyright (C) 2018 dimercur
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SERVER_H_
#define _SERVER_H_
#include "image.h"
#define DEFAULT_SERVER_PORT 2323
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);
int sendImage(Jpg *image);
#endif /* _SERVER_H_ */
openServer
int openServer(int port)
Open server port, connect and listen to given port.
image.h
Functions for image treatment.
closeServer
int closeServer()
Close server.
sendImage
int sendImage(Jpg *image)
Send image to monitor using default client ID.
Jpg
vector< unsigned char > Jpg
Definition: image.h:67
receiveDataFromServerFromClient
int receiveDataFromServerFromClient(int client, char *data, int size)
Read data from monitor, using specific client ID.
receiveDataFromServer
int receiveDataFromServer(char *data, int size)
Read data from monitor.
sendDataToServer
int sendDataToServer(char *data, int length)
Send given data to monitor.
sendDataToServerForClient
int sendDataToServerForClient(int client, char *data, int length)
Send given data to monitor, using specific client ID.
acceptClient
int acceptClient()
Wait for a client to connect.