1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

We prefer ipv4, only use ipv6 if ipv4 is disabled. 3.0.59

This commit is contained in:
winlin 2019-10-07 10:34:55 +08:00
parent b0227e0d22
commit e045b0a619
7 changed files with 30 additions and 18 deletions

View file

@ -1017,9 +1017,8 @@ srs_error_t SrsServer::listen_rtmp()
for (int i = 0; i < (int)ip_ports.size(); i++) {
SrsListener* listener = new SrsBufferListener(this, SrsListenerRtmpStream);
listeners.push_back(listener);
std::string ip;
int port;
int port; string ip;
srs_parse_endpoint(ip_ports[i], ip, port);
if ((err = listener->listen(ip, port)) != srs_success) {
@ -1113,7 +1112,7 @@ srs_error_t SrsServer::listen_stream_caster()
}
// TODO: support listen at <[ip:]port>
if ((err = listener->listen(srs_any_address4listener(), port)) != srs_success) {
if ((err = listener->listen(srs_any_address_for_listener(), port)) != srs_success) {
return srs_error_wrap(err, "listen at %d", port);
}
}