Skip to content

Commit

Permalink
Removed parameter for ConfigurePre()
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Małecki authored and rndi committed Nov 25, 2019
1 parent 5683c0a commit 3c16200
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions apps/srt-tunnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class SrtMedium: public Medium
protected:
virtual void Init() override;

void ConfigurePre(SRTSOCKET socket);
void ConfigurePre();
void ConfigurePost(SRTSOCKET socket);

using Medium::Error;
Expand Down Expand Up @@ -501,15 +501,15 @@ class TcpMedium: public Medium

protected:

void ConfigurePre(int so)
void ConfigurePre()
{
#if defined(__APPLE__)
int optval = 1;
setsockopt(so, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval));
setsockopt(m_socket, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval));
#endif
}

void ConfigurePost(int /*so*/)
void ConfigurePost(int)
{
}

Expand Down Expand Up @@ -545,11 +545,11 @@ void SrtMedium::Init()
m_options["transtype"] = "file";
}

void SrtMedium::ConfigurePre(SRTSOCKET so)
void SrtMedium::ConfigurePre()
{
vector<string> fails;
m_options["mode"] = "caller";
SrtConfigurePre(so, "", m_options, &fails);
SrtConfigurePre(m_socket, "", m_options, &fails);
if (!fails.empty())
{
cerr << "Failed options: " << Printable(fails) << endl;
Expand All @@ -572,7 +572,7 @@ void SrtMedium::CreateListener()

m_socket = srt_create_socket();

ConfigurePre(m_socket);
ConfigurePre();

sockaddr_in sa = CreateAddrInet(m_uri.host(), m_uri.portno());

Expand All @@ -599,7 +599,7 @@ void TcpMedium::CreateListener()
int backlog = 5; // hardcoded!

m_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
ConfigurePre(m_socket);
ConfigurePre();

sockaddr_in sa = CreateAddrInet(m_uri.host(), m_uri.portno());

Expand Down Expand Up @@ -657,15 +657,15 @@ unique_ptr<Medium> TcpMedium::Accept()
void SrtMedium::CreateCaller()
{
m_socket = srt_create_socket();
ConfigurePre(m_socket);
ConfigurePre();

// XXX setting up outgoing port not supported
}

void TcpMedium::CreateCaller()
{
m_socket = ::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
ConfigurePre(m_socket);
ConfigurePre();
}

void SrtMedium::Connect()
Expand Down

0 comments on commit 3c16200

Please sign in to comment.