Skip to content
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

Removing rendezvous restriction for matching local and remote ports #1204

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/API-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,6 @@ setting the `SRTO_RENDEZVOUS` option to true, and doing `srt_connect`.
* `SRT_ECONNSOCK`: Socket `u` is already connected
* `SRT_ECONNREJ`: Connection has been rejected

**NOTE:** The port value shall be the same in `local_name` and `remote_name`.

IMPORTANT: It's not allowed to perform a rendezvous connection to two
different families (that is, both `local_name` and `remote_name` must be `AF_INET` or
`AF_INET6`).
Expand Down
2 changes: 1 addition & 1 deletion docs/srt-live-transmit.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ specified in the URI:
- The *host* part specifies the remote host to contact.
- The *port* part specifies **both local and remote port**. Note that the local port is this way both listening port and outgoing port.
- The **adapter** parameter can be used to specify the adapter.
- The **port** parameter is not used.
- The **port** parameter can be used to specify the local port to bind to.

Some parameters handled for SRT medium are specific, all others are socket options. The following parameters are handled special way by *srt-live-transmit*:

Expand Down
7 changes: 2 additions & 5 deletions srtcore/srt_c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,8 @@ int srt_rendezvous(SRTSOCKET u, const struct sockaddr* local_name, int local_nam
sockaddr_in* local_sin = (sockaddr_in*)local_name;
sockaddr_in* remote_sin = (sockaddr_in*)remote_name;

if (local_sin->sin_port != remote_sin->sin_port)
return CUDT::APIError(MJ_NOTSUP, MN_INVAL, 0);

int st = srt_bind(u, local_name, local_namelen);
if ( st != 0 )
const int st = srt_bind(u, local_name, local_namelen);
if (st != 0)
return st;

return srt_connect(u, remote_name, remote_namelen);
Expand Down