void ServerLoop() { while (_udpClient != null) { try { var data = _udpClient.Receive(ref _endPoint); lock (_osc) _osc.FeedData(data); } catch (SocketException) { // It might exited by a timeout, so do nothing. } } }
void ServerLoop() { try { while (true) { var data = _udpClient.Receive(ref _endPoint); lock (_osc) _osc.FeedData(data); } } catch (SocketException) { // Shutdown: nothing to do here. } }