     self.port = (UserDefaults.standard.value(forKey: PORT) as? Int) ?? 6666
   }
   deinit {
-    socketUdp.close()
-    socketTcp.disconnect()
     print(">>> socket dead..")
   }
 }

  var currentSocketMode: SocketMode = .UDP {
    didSet {
      if currentSocketMode == .UDP {
        self.socketTcp.disconnect()
      } else {
        self.reconnectTcp()
      }
    }
  }


  lazy var socketTcp: GCDAsyncSocket = {
    let socket = GCDAsyncSocket(delegate: self, delegateQueue: DispatchQueue.main)
    do {
      try socket.connect(toHost: self.host, onPort: UInt16(self.port))
    } catch let err as NSError {
      print(">>> Error while initializing socket: \(err.localizedDescription)")
      socket.disconnect()
    }
    return socket
  }()

  private func reconnectTcp() {
    if self.socketTcp.isConnected {
      self.socketTcp.disconnect()
    }
    do {
      try self.socketTcp.connect(toHost: self.host, onPort: UInt16(self.port))
    } catch let err as NSError {
