-
Notifications
You must be signed in to change notification settings - Fork 866
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
Added connection callback, called when the async connection succeeded or failed #1487
Added connection callback, called when the async connection succeeded or failed #1487
Conversation
|
|
We have listener callback, that is called on every incoming connection request (conclusion stage) before accepting it. Now we are going to have connection callback that is called only if the connection has failed, and not called when the connection succeeds. |
Connection callback upon success at the link level is of less interest than failure. connection success is of interest to start sending and this is more for the group socket than the individual links. Connection failure/timeout is of interest at the link level to reissue a link reconnect. |
Yes, but it should be there for consistency. You still can distinguish these situations by checking the error code. Also it's not exactly for knowing if to "start sending" - that you know from the group readiness. When the group is connected, it doesn't report any new links connected - you still you the group for sending, no matter how many links it is currently utilizing. |
In the case of listener callback, there is a possibility to reject the connection. Note. Don't forget to update the docs with the new function. |
It is intended mainly for the failed group member connections, but:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor edits.
Co-authored-by: stevomatthews <smatthews@haivision.com>
Fixes #1464
This adds the connection callback, which is called in case when the connection that is to be completed in the background is finished, that is, succeeded or failed.
The statement as to whether this could be called in synchronous mode should be left undefined. The only cases when it is intended to be used is:
SRTO_RCVSYN=false
) - as an alternative for epoll.By registerring a callback by
srt_connect_callback
, you install a function that will be called at the moment, when the connection process about the single socket is done. The callback gets:SRT_SUCCESS
if the connection succeeded)sockaddr*
The additional reject reason can be obtained by
srt_getrejectreason
on the socket.