@SuppressWarnings("unchecked")
	public void listen() {
		try {

			SSLContext sc = SSLContext.getInstance("TLS");
			sc.init(null, null, null);

			SSLServerSocketFactory ssf = sc.getServerSocketFactory();
			SSLServerSocket socketS = (SSLServerSocket) ssf.createServerSocket(port);

			bb.net.util.Socket.enableAnonConnection(socketS);

			if(MH != null) {
				//MH.println("Awaiting connections on " + socketS.getLocalSocketAddress());
				while(continueLoop) {
					SSLSocket s = (SSLSocket) socketS.accept();
					if(!continueLoop) {
						s.close();
						break;
					}

					BasicIOHandler c = new BasicIOHandler(s.getInputStream(), s.getOutputStream(), MH, false);

					clientSocketList.add(s);
					MH.getConnections().add(c);
					Thread t = new Thread(c);
					t.start();

					updateUserCount();
				}
				MH.setServerStatus(ServerStatus.SHUTDOWN);
				MH.sendPackage(new DisconnectPacket(), MH.ALL());
				for(IIOHandler ica : MH.getConnections()) {
					try {
						ica.stop();
					} catch(Throwable e) {
						e.printStackTrace();
					}
				}
				MH.getConnections().clear();
			}

		} catch(KeyManagementException | NoSuchAlgorithmException | IOException e) {
			e.printStackTrace();
		}

	}