void listen() { Thread listenThread = new Thread(() => { try { SocketData data = (SocketData)socket.Receive(); ProcessData(data); } catch (Exception e) { } }); listenThread.IsBackground = true; listenThread.Start(); }