established connection between Client and Serveur, setting up basic interactions
This commit is contained in:
@@ -13,6 +13,10 @@ public class Server {
|
||||
new Thread(this::readMessages).start();
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return this.socket.getLocalPort();
|
||||
}
|
||||
|
||||
private void sendMessage(String message, InetAddress address, int port) throws IOException {
|
||||
byte[] buffer = message.getBytes();
|
||||
DatagramPacket packet = new DatagramPacket(buffer, buffer.length, address, port);
|
||||
|
||||
Reference in New Issue
Block a user