Initial RetroNFS95 Win9x VxD prototype
This commit is contained in:
38
include/socket.hpp
Normal file
38
include/socket.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef RETRONFS95_SOCKET_HPP
|
||||
#define RETRONFS95_SOCKET_HPP
|
||||
|
||||
#include "compat.hpp"
|
||||
|
||||
namespace retronfs {
|
||||
|
||||
class SocketSystem {
|
||||
public:
|
||||
SocketSystem();
|
||||
~SocketSystem();
|
||||
};
|
||||
|
||||
class TcpSocket {
|
||||
public:
|
||||
TcpSocket();
|
||||
~TcpSocket();
|
||||
|
||||
void connect_to(const std::string& host, unsigned short port, unsigned timeout_ms);
|
||||
void send_all(const Bytes& data);
|
||||
Bytes recv_exact(unsigned count);
|
||||
void close();
|
||||
|
||||
private:
|
||||
TcpSocket(const TcpSocket&);
|
||||
TcpSocket& operator=(const TcpSocket&);
|
||||
|
||||
#ifdef _WIN32
|
||||
unsigned int fd_;
|
||||
#else
|
||||
int fd_;
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user