// be processed in another thread reading data from the socket.
// That's why below code first removes service from reading
// threads pool and then sends <proceed> packet and starts TLS.
Element proceed = Command.getData(packet, "proceed", null);
Packet p_proceed = new Packet(proceed);
SocketReadThread readThread = SocketReadThread.getInstance();
readThread.removeSocketService(serv);
// writePacketToSocket(serv, p_proceed);
serv.addPacketToSend(p_proceed);
serv.processWaitingPackets();
serv.startTLS(false);
// serv.call();
readThread.addSocketService(serv);
} catch (IOException e) {
log.warning("Error starting TLS: " + e);
} // end of try-catch
} else {
log.warning("Can't find sevice for STARTTLS command: " +