New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer overflow in TcpConnection.send #134
Comments
This seems to be associated always with the KeepAlive object, I was previously sending one out every 50 ms, which may be an issue. Still trying to deduce more information on the problem. |
Can you provide a stacktrace and maybe an example (if possible)? |
Argh, didn't have my server debugger running at the time, but this is a stack trace of the error, after about 12 hours: Exception in thread "Timer-0" Exception in thread "Server" Exception in thread "main" java.lang.IllegalArgumentException I can add some example code this evening. |
Server:
Client:
LeptonFrame, Point, and LeptonROI contain all basic primitives (int and float), except for one Float[] object with the pixels. |
In the crash log it says:
but line 188 is not the send()-Method and doesn't call Buffer.position(). What code base are you currently using? Two other things:
|
Thanks for looking into this. I am using the releases, specifically the production one jar file. Is there a specific fork that you recommend? |
I made a fork myself a few days ago and that is probably the most actively maintained one right now: github.com/crykn/kryonet. |
Ok, thanks very much for everyone's help. I'll mark this as closed as an issue regarding an older version of Kryo. |
As @crykn wrote
I tried to use it for android development. But I have Compability problem:
Please help me out. |
My last Issue solved using Gradle 4 and Android Studio 3. Wish it work on previous versions.
My server code is something like this.
Any suggestion to send large files 10GB and more using kryonet ? |
Did you change the servers internal byte buffer size via the constructor ( |
How much should I put there ? It allocates memory and I cannot put big numbers like 1010241024*1024 |
Your stack trace shows that the buffer requires a size of at least 65535 bytes. |
No matter what I put. For 60MB file it will finally crash
nor
Nothing works. I think that 65535 bytes is amount of bytes it needs to send this chunk. and no matter what the next chunk will broke. |
You could try using the built-in |
Dear @crykn you are right. |
I have no idea why the buffer is overlowing, normally it should flush itself. Did you try the |
Dear @cyrkn inputStreamSender works. As I noticed it will flush itself after the object completely sent. But it also buffers sending objects and this functionality overlfows. So I forced to limit my request and also check for the buffer size before adding an object to send. |
I have just ran into this error while repeatedly calling |
Sorry @faucct It's been so long that I can not remember what are we talking about it here. Please apologize me for not being helpful and also not clear enough about what solved my problem in the first place. |
Howdy,
Love the library, it has been such an easy networking client to work with, and I've used it in multiple projects.
For one particular project, I have a client connected to a server streaming frames from a camera. Everything works great, but as the connection time gets longer, in the 10's of hours range, there is eventually a buffer overflow on the server side which causes the Server send thread to shut down.
The client and server have write and object buffer sizes 50,000, which is sufficient (camera frames are small).
I've tracked the issue down to the TcpConnection.send BufferOverflow, but I'm not sure if it is the writebuffer or the serialization object.
I would like to kick around some ideas on how to fix this.
The text was updated successfully, but these errors were encountered: