@Override
	public void disconnect(IIOHandler a) {
		log.fine("Disconnect:"+a);
		if(side == Side.CLIENT) {

			if(SERVER != null) {
				sendPackage(new DisconnectPacket(), SERVER());
				SERVER.stop();
				SERVER = null;
			}
			try {
				if(socket != null) {
					socket.close();
				}

			} catch(IOException e) {
				e.printStackTrace();
			}

		} else {
			if(a != ALL() && a != SERVER()) {
				a.stop();
				connections.remove(a);
			} else {
				synchronized(connections) {
					connections.forEach(bb.net.interfaces.IIOHandler::stop);
					connections.clear();
				}
			}
		}

	}