Some clean and test, befor merge

win-support
unknown 1 year ago
parent 2118270646
commit 4388730e9f
  1. 2
      lib/tcp_socket.hpp
  2. 5
      src/tcp_socket.cpp
  3. BIN
      test/client.exe
  4. BIN
      test/server.exe

@ -39,6 +39,7 @@ class server {
#if __linux__
int sock;
#elif _WIN32
WSADATA wsa;
SOCKET sock;
#endif
struct sockaddr_in addr;
@ -79,6 +80,7 @@ class client {
#if __linux__
int conn; // mijenja sock
#elif _WIN32
WSADATA wsa;
SOCKET conn; // mijenja sock
#endif
struct sockaddr_in addr;

@ -12,7 +12,6 @@ server::server (const ushort port, const uint limit, SSL_CTX* _securefds) {
addr.sin_port = htons(port);
#if _WIN32
WSADATA wsa;
if (WSAStartup(MAKEWORD(2,2),&wsa) != 0) {
throw string("[ERROR] WSA Startup. Detail: " + to_string(WSAGetLastError()));
}
@ -144,7 +143,6 @@ secure::~secure () {
client::client(const string address, const ushort port, const uint timeout, SSL_CTX* securefds) {
#if _WIN32
WSADATA wsa;
if (WSAStartup(MAKEWORD(2,2),&wsa) != 0) {
throw string("[ERROR] Unable to set WinSock " + to_string(WSAGetLastError()));
}
@ -180,9 +178,6 @@ client::client(const string address, const ushort port, const uint timeout, SSL_
}
#endif
if (securefds) {
ssl = SSL_new(securefds);
if (!ssl) {

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save