-
Notifications
You must be signed in to change notification settings - Fork 58
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
Non-blocking SCTP Socket #41
Comments
I tried setting SCTP socket in non-blocking mode using SetNonblock() but then accept call fails with temporary failure and keeps logging errors. Everything else works as expected except these huge amount of logs. Can we at least disable the log for the temporary failures? specifically talking about
|
Are you talking about this line? |
my bad, i was working on go-diameter library and was having same issue there also. you can ignore/ delete my comments. |
@vk-coder can you elaborate how exactly are you using SetNonblock to make the sctp Accept nonblocking? The fd field in SCTPListener in not public. |
I followed example given at bare example this is how I created Non Blocking sctp listner
then
|
@vk-coder Thank you for sharing your example. So you are using sctp-go from thebagchi and not ishidawataru sctp. |
I have test the code like following:
In short it's just goroutine the
accept
and close the listener. In TCP test,accept
will return error and we can use error handling to close the socket. But in SCTP, the accept will not return error and keep binding on the fd. Therefor, we cannot reuse the address.After I take a look of TCP's implementation, I found that TCP is using non-blocking flag in syscall. Due to the reason,
accept
won't block the fd in system and can successfully return the error when listener close.Is it possible to change the architecture of SCTP to non-blocking socket type?
The text was updated successfully, but these errors were encountered: