Skip to content

Basic Client

gcflames5 edited this page Aug 23, 2014 · 1 revision

Just like a basic server, a basic client is quite easy to create using ServerInterconnect.

The code is the same for both unencrypted and encrypted connections, it automatically detects whether the server it is connecting to is encrypted or not.

Creating a basic client is very simple:

//Address that you wish to connect to
String address = "127.0.0.1";

//Port that you wish to connect to
int port = 1337;

//Create a client manager
TcpClientManager manager = new TcpClientManager(address, port);

//Initialize the connection
try { manager.initialize(); } 
catch (IOException e) { /* handle exception */ }

Clone this wiki locally