Skip to content

Commit 67d360f

Browse files
committed
Add --enabletcp option for server
1 parent bb35af3 commit 67d360f

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ int main ( int argc, char** argv )
9696
bool bUseTranslation = true;
9797
bool bCustomPortNumberGiven = false;
9898
bool bEnableIPv6 = false;
99+
bool bEnableTcp = false;
99100
int iNumServerChannels = DEFAULT_USED_NUM_CHANNELS;
100101
quint16 iPortNumber = DEFAULT_PORT_NUMBER;
101102
int iJsonRpcPortNumber = INVALID_PORT;
@@ -251,6 +252,16 @@ int main ( int argc, char** argv )
251252

252253
// Server only:
253254

255+
// Enable TCP server ---------------------------------------------------
256+
if ( GetFlagArgument ( argv, i, "--enabletcp", "--enabletcp" ) )
257+
{
258+
bEnableTcp = true;
259+
qInfo() << "- TCP server enabled";
260+
CommandLineOptions << "--enabletcp";
261+
ServerOnlyOptions << "--enabletcp";
262+
continue;
263+
}
264+
254265
// Disconnect all clients on quit --------------------------------------
255266
if ( GetFlagArgument ( argv, i, "-d", "--discononquit" ) )
256267
{
@@ -993,6 +1004,7 @@ int main ( int argc, char** argv )
9931004
bDisableRecording,
9941005
bDelayPan,
9951006
bEnableIPv6,
1007+
bEnableTcp,
9961008
eLicenceType );
9971009

9981010
#ifndef NO_JSON_RPC
@@ -1117,6 +1129,7 @@ QString UsageArguments ( char** argv )
11171129
" --norecord set server not to record by default when recording is configured\n"
11181130
" -s, --server start Server\n"
11191131
" --serverbindip IP address the Server will bind to (rather than all)\n"
1132+
" --enabletcp enable TCP server for Jamulus protocol\n"
11201133
" -T, --multithreading use multithreading to make better use of\n"
11211134
" multi-core CPUs and support more Clients\n"
11221135
" -u, --numchannels maximum number of channels\n"

src/server.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ CServer::CServer ( const int iNewMaxNumChan,
4444
const bool bDisableRecording,
4545
const bool bNDelayPan,
4646
const bool bNEnableIPv6,
47+
const bool bNEnableTcp,
4748
const ELicenceType eNLicenceType ) :
4849
bUseDoubleSystemFrameSize ( bNUseDoubleSystemFrameSize ),
4950
bUseMultithreading ( bNUseMultithreading ),
@@ -69,6 +70,7 @@ CServer::CServer ( const int iNewMaxNumChan,
6970
bAutoRunMinimized ( false ),
7071
bDelayPan ( bNDelayPan ),
7172
bEnableIPv6 ( bNEnableIPv6 ),
73+
bEnableTcp ( bNEnableTcp ),
7274
eLicenceType ( eNLicenceType ),
7375
bDisconnectAllClientsOnQuit ( bNDisconnectAllClientsOnQuit ),
7476
pSignalHandler ( CSignalHandler::getSingletonP() )

src/server.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ class CServer : public QObject, public CServerSlots<MAX_NUM_CHANNELS>
104104
const bool bDisableRecording,
105105
const bool bNDelayPan,
106106
const bool bNEnableIPv6,
107+
const bool bNEnableTcp,
107108
const ELicenceType eNLicenceType );
108109

109110
virtual ~CServer();
@@ -299,6 +300,9 @@ class CServer : public QObject, public CServerSlots<MAX_NUM_CHANNELS>
299300
// enable IPv6
300301
bool bEnableIPv6;
301302

303+
// enable TCP Server
304+
bool bEnableTcp;
305+
302306
// messaging
303307
QString strWelcomeMessage;
304308
ELicenceType eLicenceType;

0 commit comments

Comments
 (0)