-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
java.lang.IllegalArgumentException Tcp Sockets: No socket with id #167
Comments
@pajkho, this is a common issue if you are trying to use the socket while it has not established a connection yet. Make sure you wait for the connection callback before using the socket. |
The issue arises for us when having continuous writes to the tcp connection which doesn't stop until the end event happens. If the connection closes there can be a gap between the close of the connection and the end event where there is new writes which causes this error and the app crashes. Wouldn't it be more reasonable to try/catch this to prevent the app from crashing and instead call the error event? It shouldn't be possible to crash the app because you mistakenly try to write to a closed connection. |
@pajkho, indeed, I will release a fix ASAP. |
## [6.0.6](v6.0.5...v6.0.6) (2023-02-08) ### Bug Fixes * **Android:** Avoid crash when writing on closed socket. ([466a5db](466a5db)), closes [#167](#167)
🎉 This issue has been resolved in version 6.0.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hello, this fix is missing in version 6.1.0 |
@yang-Ann, this fix is included in the latest version. The solution was to remove |
Thank you very much
…------------------ 原始邮件 ------------------
发件人: "Rodrigo ***@***.***>;
发送时间: 2024年7月9日(星期二) 下午5:37
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [Rapsssito/react-native-tcp-socket] java.lang.IllegalArgumentException Tcp Sockets: No socket with id (Issue #167)
@yang-Ann, this fix is included in the latest version. The solution was to remove socketMap.remove(cId);.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Description
Sometimes when the connection gets interrupted while writing data the app will crash with "No socket with id" error. I suspect that this might be due to the write method not catching the errors that is thrown by getTcpClient method.
Steps to reproduce
Steps to reproduce the behavior:
Current behavior
App crashes with error
Expected behavior
Connection can close but app should not crash.
Relevant information
The text was updated successfully, but these errors were encountered: