xale-db 1.0
minimal SQL engine, written in c++
Loading...
Searching...
No Matches
LinuxSocket.h
Go to the documentation of this file.
1#if defined(__linux__) || defined(linux) || defined(__GNUG__)
2
3#ifndef NET_LINUX_SOCKET_H
4#define NET_LINUX_SOCKET_H
5
6#include <Logger.h>
7
9
10#include <sys/socket.h>
11#include <netinet/in.h>
12#include <arpa/inet.h>
13#include <unistd.h>
14#include <cstring>
15#include <string>
16
17namespace Xale::Net
18{
19 class LinuxSocket : public ISocket
20 {
21 public:
22 LinuxSocket();
23 bool connect(const std::string& hostAddress, int port) override;
24 int send(const std::string* data, size_t size) override; // should be SecurePaquet in the future
25 int receive(std::string* buffer, size_t size) override;
26 void close() override;
27 private:
28 Xale::Logger::Logger<LinuxSocket>& _logger;
29 int _socket;
30 sockaddr_in _address;
31 };
32}
33
34#endif // NET_LINUX_SOCKET_H
35
36#endif
Definition ISocket.h:9
Definition IListenerSocket.h:7