mirror of
https://github.com/LX3JL/xlxd.git
synced 2026-01-07 17:21:01 +01:00
Add ability to specify IP to use for listening to ambed
This commit is contained in:
parent
dd14d763f1
commit
8239493fa8
|
|
@ -97,9 +97,10 @@ bool CCodecStream::Init(uint16 uiPort)
|
|||
// create server's IP
|
||||
m_Ip = g_Reflector.GetTranscoderIp();
|
||||
m_uiPort = uiPort;
|
||||
CIp interfaceIp = g_Reflector.GetTranscoderInterfaceIp();
|
||||
|
||||
// create our socket
|
||||
ok = m_Socket.Open(CIp("0.0.0.0"), uiPort);
|
||||
ok = m_Socket.Open(interfaceIp, uiPort);
|
||||
if ( ok )
|
||||
{
|
||||
// start thread;
|
||||
|
|
|
|||
|
|
@ -59,8 +59,10 @@ public:
|
|||
const CCallsign &GetCallsign(void) const { return m_Callsign; }
|
||||
void SetListenIp(const CIp &ip) { m_Ip = ip; }
|
||||
void SetTranscoderIp(const CIp &ip) { m_AmbedIp = ip; }
|
||||
void SetTranscoderInterfaceIp(const CIp &ip) { m_AmbedInterfaceIp = ip; }
|
||||
const CIp &GetListenIp(void) const { return m_Ip; }
|
||||
const CIp &GetTranscoderIp(void) const { return m_AmbedIp; }
|
||||
const CIp &GetTranscoderInterfaceIp(void) const { return m_AmbedInterfaceIp; }
|
||||
|
||||
// operation
|
||||
bool Start(void);
|
||||
|
|
@ -121,6 +123,7 @@ protected:
|
|||
CCallsign m_Callsign;
|
||||
CIp m_Ip;
|
||||
CIp m_AmbedIp;
|
||||
CIp m_AmbedInterfaceIp;//Ip used ot talk to ambed IP
|
||||
|
||||
// objects
|
||||
CUsers m_Users; // sorted list of lastheard stations
|
||||
|
|
|
|||
|
|
@ -95,9 +95,11 @@ bool CTranscoder::Init(void)
|
|||
|
||||
// create server's IP
|
||||
m_Ip = g_Reflector.GetTranscoderIp();
|
||||
CIp interfaceIp = g_Reflector.GetTranscoderInterfaceIp();
|
||||
|
||||
|
||||
// create our socket
|
||||
ok = m_Socket.Open(CIp("0.0.0.0"), TRANSCODER_PORT);
|
||||
ok = m_Socket.Open(interfaceIp, TRANSCODER_PORT);
|
||||
if ( ok )
|
||||
{
|
||||
// start thread;
|
||||
|
|
@ -105,7 +107,7 @@ bool CTranscoder::Init(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Error opening socket on port UDP" << TRANSCODER_PORT << " on ip " << g_Reflector.GetListenIp() << std::endl;
|
||||
std::cout << "Transcoder Error opening socket on port UDP" << TRANSCODER_PORT << " on ip " << g_Reflector.GetListenIp() << std::endl;
|
||||
}
|
||||
|
||||
// done
|
||||
|
|
|
|||
|
|
@ -87,10 +87,11 @@ int main(int argc, const char * argv[])
|
|||
#endif
|
||||
|
||||
// check arguments
|
||||
if ( argc != 4 )
|
||||
if ( argc < 4 || argc > 5)
|
||||
{
|
||||
std::cout << "Usage: xlxd callsign xlxdip ambedip" << std::endl;
|
||||
std::cout << "example: xlxd XLX999 192.168.178.212 127.0.0.1" << std::endl;
|
||||
std::cout << "Usage: xlxd callsign xlxdip ambedip [interface_to_reach_ambed] " << std::endl;
|
||||
std::cout << "example (ambed running locally): xlxd XLX999 192.168.178.212 127.0.0.1" << std::endl;
|
||||
std::cout << "example (ambed running on another host): xlxd XLX999 192.168.178.212 10.9.0.100 10.9.0.1" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -101,6 +102,7 @@ int main(int argc, const char * argv[])
|
|||
g_Reflector.SetCallsign(argv[1]);
|
||||
g_Reflector.SetListenIp(CIp(argv[2]));
|
||||
g_Reflector.SetTranscoderIp(CIp(CIp(argv[3])));
|
||||
g_Reflector.SetTranscoderInterfaceIp(CIp(argv[argc == 5 ? 4 : 2]));
|
||||
|
||||
// and let it run
|
||||
if ( !g_Reflector.Start() )
|
||||
|
|
|
|||
Loading…
Reference in a new issue