Skip to content

Commit

Permalink
Test works
Browse files Browse the repository at this point in the history
  • Loading branch information
ILikePizza555 committed Dec 7, 2018
1 parent 789103e commit 21e7a50
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/system/server_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <sockets/TCPServerSocket.h>
#include <sockets/Error.h>
#include <sockets/Byte.h>
#include <sockets/abl/win32.h>
#include <tuple>
#include <iostream>

Expand All @@ -11,8 +13,13 @@ using std::endl;

int main(int argc, char** argv)
{
TCPServerSocket server("127.0.0.1", "22");
cout << "Listening on port 22..." << endl;
#ifdef _WIN32
sockets::abl::win32::WinSockDLL dll;
std::cout << "Initalized WinSock dll." << std::endl;
#endif

TCPServerSocket server("127.0.0.1", "1022");
cout << "Listening on port 1022..." << endl;

TCPConnection conn;
sockets::abl::IpAddress ip;
Expand All @@ -24,7 +31,7 @@ int main(int argc, char** argv)
{
try {
// Check connection state
conn.write<1>({1});
conn.write<1>(ByteString<1>{{1}});

auto b = conn.read(128);
cout << "[" << ip.name() << ":" << ip.port() << "] " << b << endl;
Expand Down

0 comments on commit 21e7a50

Please sign in to comment.