SuperSocket.ClientEngine
SuperSocket.ClientEngine copied to clipboard
Throw InvalidOperationException in TcpClientSession.Connect() instead of Exception()
When connect() is called on a TcpClientSession that is already connected or in process of being connected, an InvalidOperationException should be thrown, not a generic Exception.
https://github.com/kerryjiang/SuperSocket.ClientEngine/blob/6f02bd65c1d9b14c829e04e0a5a42d70dd2f4317/Core/TcpClientSession.cs#L107
https://github.com/kerryjiang/SuperSocket.ClientEngine/blob/6f02bd65c1d9b14c829e04e0a5a42d70dd2f4317/Core/TcpClientSession.cs#L110
This mimics System.Net.Socket.ConnectAsync()'s exceptions: https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.connectasync?view=netframework-4.8