54 lines
897 B
C++
54 lines
897 B
C++
#ifndef _SERVER_HH_
|
|
#define _SERVER_HH_
|
|
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
#include <arpa/inet.h>
|
|
#include <netdb.h>
|
|
#include <net/if.h>
|
|
#include <sys/types.h>
|
|
|
|
#include <boost/program_options.hpp>
|
|
|
|
#include "point.hh"
|
|
#include "positioning.hh"
|
|
#include "measurement.hh"
|
|
#include "treatment.hh"
|
|
#include "libowlps-positioning.hh"
|
|
|
|
class Server
|
|
{
|
|
|
|
private:
|
|
request att_request;
|
|
vector<couple_info> recv_info;
|
|
|
|
int listen_port;
|
|
int mobile_port;
|
|
int listen_socket;
|
|
|
|
PGconn *conn;
|
|
|
|
Positioning pos;
|
|
|
|
public:
|
|
Server(int port, int mport)
|
|
{
|
|
listen_port = port;
|
|
mobile_port = mport;
|
|
};
|
|
~Server()
|
|
{
|
|
close(listen_socket);
|
|
PQfinish(conn);
|
|
};
|
|
|
|
int start();
|
|
int init(const boost::program_options::variables_map);
|
|
void treatment();
|
|
void createResult(Point, int, string);
|
|
void sendToClient(Point, char *);
|
|
};
|
|
|
|
#endif // _SERVER_HH_
|