2019-03-25 09:18:06 +11:00
|
|
|
#include "lib/socket/socket.h"
|
|
|
|
#include <cstdlib>
|
2019-03-20 14:13:25 +11:00
|
|
|
|
|
|
|
client_tcp *client;
|
|
|
|
|
2019-03-25 09:18:06 +11:00
|
|
|
void connections_init(int argc, char const* argv[])
|
2019-03-20 14:13:25 +11:00
|
|
|
{
|
2019-03-25 09:18:06 +11:00
|
|
|
// Get the port
|
|
|
|
int port = PORT_DEFAULT;
|
|
|
|
|
|
|
|
// Did the user specify a port
|
|
|
|
if(argc > 2)
|
|
|
|
{
|
|
|
|
// Set the port to the specified one
|
|
|
|
port = atoi(argv[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Create a client
|
|
|
|
client = new client_tcp(argv[1], port);
|
2019-03-20 14:13:25 +11:00
|
|
|
}
|