Make NetworkConnection send(T data) method synchronized

This commit is contained in:
Andrin Fassbind 2022-04-10 14:14:11 +02:00
parent 5054224653
commit 361037ab9a
1 changed files with 1 additions and 1 deletions

View File

@ -305,7 +305,7 @@ public class NetworkHandler {
* @param data data object of type T to be submitted through the connection. * @param data data object of type T to be submitted through the connection.
* @throws IOException if an error occurs (e.g. connection interrupted while sending, ...) * @throws IOException if an error occurs (e.g. connection interrupted while sending, ...)
*/ */
public void send(T data) throws IOException { public synchronized void send(T data) throws IOException {
ObjectOutputStream outputStream = new ObjectOutputStream(socket.getOutputStream()); ObjectOutputStream outputStream = new ObjectOutputStream(socket.getOutputStream());
outputStream.writeObject(data); outputStream.writeObject(data);
} }