SpeechRecognizer.UDPClient.StopClient C# (CSharp) Method

StopClient() public method

Tells the UDP client to stop listening for packets.
public StopClient ( ) : void
return void
        public void StopClient()
        {
            // Set the boolean to false to stop the asynchronous packet receiving
            listening = false;
            client.Close();
            audioStream.Close();
            //client.EndReceive(currentReceive, ref endPoint);
            Console.WriteLine(" [UDPClient] Stopped listening on port " + port);
        }