mainSocket of SocketWorker is optional