diff options
author | lonkaars <loek@pipeframe.xyz> | 2024-05-20 13:33:25 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2024-05-20 13:33:25 +0200 |
commit | 27c8d89359b8d5e97c4c23ff464d5f3de7279709 (patch) | |
tree | 4216d0beffa74d87fd2802c40c4dc47ca3d9e4d3 /client | |
parent | 41ed6fa61a65432843feb596726026bc5772ae19 (diff) |
fix bad file descriptor error
Diffstat (limited to 'client')
-rw-r--r-- | client/main.cpp | 3 | ||||
-rw-r--r-- | client/sock.cpp | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/client/main.cpp b/client/main.cpp index 36fc7bb..c01dbb5 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -17,9 +17,10 @@ int main(int argc, char** argv) { uint16_t port = 9191; if (argc >= 3) port = atoi(argv[2]); + PBSocket sock(addr, port); try { // connect to TCP socket (automatically spawns thread) - PBSocket sock(addr, port); + sock.sock_connect(); } catch (const std::exception& e) { printf("error: %s\n", e.what()); return EXIT_FAILURE; diff --git a/client/sock.cpp b/client/sock.cpp index 17d9e35..c10fba0 100644 --- a/client/sock.cpp +++ b/client/sock.cpp @@ -19,7 +19,6 @@ using std::thread; PBSocket::PBSocket() { } PBSocket::PBSocket(char* addr, uint16_t port) : PBSocket() { set_server(addr, port); - sock_connect(); } PBSocket::~PBSocket() { |