Giter Club home page Giter Club logo

Comments (9)

vtortola avatar vtortola commented on July 17, 2024

Which version are you using, on which framework and how are you configuring the component?

I have never seen anything like that before.

from websocketlistener.

pmace avatar pmace commented on July 17, 2024

2.1.3 as a Xamarin PCL project...IOS and Android.

Listener works fine, and so does plain WebSocket...except for the fact the underlying TCP connection closes @ ~3:20 without generating any notification. The Websocket object continues to report Open, but the socket is closed and disposed.

from websocketlistener.

pmace avatar pmace commented on July 17, 2024

also, this is a pull from git, not the nuget package. It was necessary to use the default buffer, not buffer manager, and remove some of the .Net logging statements to get it to compile for PCL IOS and Android. Neither of those mods were otherwise significant.

from websocketlistener.

pmace avatar pmace commented on July 17, 2024

2.1.6 pull compiles without mods. But it still closes the underlying socket.
Tried engaging the server with a stimulus/response exchange of a couple of bytes every 30 seconds, but this had no effect. Neither did setting KeepAlive to 30 seconds.

from websocketlistener.

vtortola avatar vtortola commented on July 17, 2024

What happens when the socket is closed and you try to send something? Does it throw an exception?

from websocketlistener.

pmace avatar pmace commented on July 17, 2024

2015-04-14 15:47:40.023 1Dir.iOS[9550:2937900] Exception: System.ObjectDisposedException: The object was used after being disposed.
at System.Net.Sockets.Socket.Send (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags) [0x00016] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.9.1.3/src/mono/mcs/class/System/System.Net.Sockets/Socket.cs:1827
at System.Net.WebSockets.ClientWebSocket+c__AnonStorey4.<>m__0 () [0x0007a] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.9.1.3/src/mono/mcs/class/System/System.Net.WebSockets/ClientWebSocket.cs:197
at System.Threading.Tasks.TaskActionInvoker+ActionInvoke.Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/TaskActionInvoker.cs:71
at System.Threading.Tasks.Task.InnerInvoke () [0x00031] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/Task.cs:548
at System.Threading.Tasks.Task.ThreadStart () [0x000d0] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/Task.cs:438
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs:60
at Dir.iOS.WSServer+c__async5.MoveNext () [0x00072] in /Users/MacOwner/Xamarin Projects/1Dir/iOS/WSServer.cs:410
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs:60
at Dir.iOS.WSServer+c__async2.MoveNext () [0x00147] in /Users/MacOwner/Xamarin Projects/1Dir/iOS/WSServer.cs:313
2015-04-14 15:47:40.024 1Dir.iOS[9550:2937870] Reconnecting...
Reconnecting...
2015-04-14 15:47:40.609 1Dir.iOS[9550:2937495] The object was used after being disposed.
The object was used after being disposed.
2015-04-14 15:47:40.610 1Dir.iOS[9550:2937495] Relay server socket is Closed!

from websocketlistener.

pmace avatar pmace commented on July 17, 2024

That was a yes. We've tested and know the server is not terminating. And no
Close request is ever recieved. Breaking inside the while state.open loop shows the underlying socket is gone. An AsyncSend provokes the exception.

from websocketlistener.

vtortola avatar vtortola commented on July 17, 2024

Humm.. I will improve the connection detection mechanism, but the reason why is disconnecting after 3m 20s... I have no idea.

from websocketlistener.

vtortola avatar vtortola commented on July 17, 2024

Sorry that exception with stack trace you posted, is coming from the built-in client in the framework (System.Net.WebSockets.ClientWebSocket), no from WebSocketListener. Do you get any exception in WebSocketListener?

from websocketlistener.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.