Package client
Class Connect
java.lang.Object
client.Connect
The connect class establishes a connection, via a TCP Socket, to the server and initialises a client.
This client is then able to both send and recieve messages from the TCP server.
- Since:
- 2023
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
The startConnection method uses the IP, port and username given from the constructor.These are used within the creation of a new Client and Socket object.
-
Constructor Details
-
Connect
The constructor of the Connect object takes in 3 parameters and assigns them.- Parameters:
name
- username of clientip
- IP of serverport
- port of server
-
-
Method Details
-
startConnection
public void startConnection()The startConnection method uses the IP, port and username given from the constructor.These are used within the creation of a new Client and Socket object. These are then sent to listen and send messages.
-