netty-socketio-demo | netty-socketio demo - If you want to open index
kandi X-RAY | netty-socketio-demo Summary
kandi X-RAY | netty-socketio-demo Summary
If you want to open index.html in Chrome or IE browser you need to host it somewhere (nginx or apache, for example), or page will not work due to absence of correct "origin" http header.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of netty-socketio-demo
netty-socketio-demo Key Features
netty-socketio-demo Examples and Code Snippets
Community Discussions
Trending Discussions on netty-socketio-demo
QUESTION
I use netty-socketio 1.7.18 in my Scala application, but after a while it shutdowns the application with an out of memory error.
I create a simple socketio client with Javascript and I constantly refresh the web page to connect/dissconnect in the browser, the heap size rises very fast(~100mb per reload) and it is never released. It goes up to 130gb.
I tried manual call GC but it doesn't release. When looking from the VisualVM, it seems that the reason are netty buffers.
At first I doubted my own Scala codes. I converted the Java demo for Netty-socketio project to Scala to create a simple server. But I realized that this problem happens when I use the netty-socketio with Scala. Anyone else has this problem? I'm looking for a solution.
...ANSWER
Answered 2021-Mar-12 at 13:06I solved with Config.setWorkerThreads(1)
Each time the page is refreshed, a new nioEventLoopGroup thread was started and the old ones were not closed.
QUESTION
I am currently trying to learn netty-socket.io using their
demo project. I keep seeing Thread.sleep(Integer.MAX_VALUE);
. Can someone please tell me why this is important?
Addition: To clarify, I am not asking what does the Thread.sleep() function do, obviously it pauses execution on a particular thread. I am asking about the relevance of it in this example socket server.
...ANSWER
Answered 2018-Apr-07 at 03:37So I figured out that this does not have anything to do with the server at all. This Thread.sleep(Integer.MAX_VALUE);
has simply paused execution of the program. To make this answer intuitive, I will change Thread.sleep(Integer.MAX_VALUE)
to Thread.sleep(4000)
in the posted code block.
ie, this would start the server, run it for 4 seconds and then stop the server.
This seems to only be here to fulfill its purpose; which is to start and stop the server, as this was taken from a demo project.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install netty-socketio-demo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page