# Closing serial port
You can close the serial port anytime. As you see at Receiving Incoming Data Guide, to close the port just call Close()
method.
# Example
private void ClosePort()
{
if (simplePort.IsOpen)
{
simplePort.Close();
simplePort.OnDataReceived -= OnReceiveData;
}
}
Made by Andres Ruiz with ❤️
All rights reserved © 2024
All rights reserved © 2024