This commit is contained in:
@@ -20,9 +20,14 @@ public abstract class Connexion implements PacketVisitor {
|
||||
this.connexionThread.start();
|
||||
}
|
||||
|
||||
public void sendPacket(Packet packet) {
|
||||
public boolean isClosed() {
|
||||
return this.socket.isClosed();
|
||||
}
|
||||
|
||||
public synchronized void sendPacket(Packet packet) {
|
||||
try {
|
||||
objectOutputStream.writeObject(packet);
|
||||
objectOutputStream.flush();
|
||||
} catch (IOException e) {
|
||||
System.err.println("Error while sending packet ! " + e.getLocalizedMessage());
|
||||
close();
|
||||
|
||||
Reference in New Issue
Block a user