From 6175441ffafa7e92a2b1d33b77f11d07d18eced4 Mon Sep 17 00:00:00 2001 From: Maxim Sharabayko Date: Sat, 21 Mar 2020 13:20:39 +0100 Subject: [PATCH 1/2] [docs] Minor fix of srt-live-transmit doc (rendezvous) --- docs/srt-live-transmit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/srt-live-transmit.md b/docs/srt-live-transmit.md index cd8f158f2..95d5434f9 100644 --- a/docs/srt-live-transmit.md +++ b/docs/srt-live-transmit.md @@ -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*: From e5d4152f07f50eedc655d98c4448f56e298289e3 Mon Sep 17 00:00:00 2001 From: Maxim Sharabayko Date: Wed, 25 Mar 2020 07:38:42 +0100 Subject: [PATCH 2/2] [core] srt_rendezvous(..): removed local-remote port check --- docs/API-functions.md | 2 -- srtcore/srt_c_api.cpp | 7 ++----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/docs/API-functions.md b/docs/API-functions.md index a1ecd7691..85f91a828 100644 --- a/docs/API-functions.md +++ b/docs/API-functions.md @@ -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`). diff --git a/srtcore/srt_c_api.cpp b/srtcore/srt_c_api.cpp index 61fd8cf67..07d9e2bdc 100644 --- a/srtcore/srt_c_api.cpp +++ b/srtcore/srt_c_api.cpp @@ -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);