WebSocket4Net icon indicating copy to clipboard operation
WebSocket4Net copied to clipboard

When trying to re-open a closed websocket I am getting SocketException "Operation not supported"

Open graboszczak opened this issue 7 years ago • 2 comments

When trying to re-open a websocket closed by the server I am getting SocketException "Operation not supported".

at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue) at System.Net.Sockets.Socket.set_ExclusiveAddressUse(Boolean value) at SuperSocket.ClientEngine.ConnectAsyncExtension.ConnectAsync(EndPoint remoteEndPoint, EndPoint localEndPoint, ConnectedCallback callback, Object state)

I am running my code with 0.15.0-beta9 version of your library on a .net core framework on Linux.

graboszczak avatar Jul 19 '17 03:07 graboszczak

@graboszczak, as a workaround, try to clear LocalEndPoint property before re-opening:

websocket.LocalEndPoint = null;
websocket.Open();

FANAT-- avatar Jul 19 '17 04:07 FANAT--

Thank you.

On Wed, Jul 19, 2017 at 12:47 AM, Павел [email protected] wrote:

@graboszczak https://github.com/graboszczak, as a workaround, try to clear LocalEndPoint property before re-opening:

websocket.LocalEndPoint = null;websocket.Open();

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kerryjiang/WebSocket4Net/issues/100#issuecomment-316271667, or mute the thread https://github.com/notifications/unsubscribe-auth/ABblKMelT7iaC28xIn3q-I3jlH977Qz_ks5sPYprgaJpZM4OcLjG .

-- Marcin

graboszczak avatar Jul 19 '17 11:07 graboszczak