Skip to content

Commit

Permalink
Change naming convention for RPC Bind Address
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob-NY committed Oct 17, 2022
1 parent bda9948 commit 205cc4b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int main ( int argc, char** argv )
int iNumServerChannels = DEFAULT_USED_NUM_CHANNELS;
quint16 iPortNumber = DEFAULT_PORT_NUMBER;
int iJsonRpcPortNumber = INVALID_PORT;
QString strJsonRpcBindAddress = DEFAULT_JSON_RPC_LISTEN_ADDRESS;
QString strJsonRpcBindIP = DEFAULT_JSON_RPC_LISTEN_ADDRESS;
quint16 iQosNumber = DEFAULT_QOS_NUMBER;
ELicenceType eLicenceType = LT_NO_LICENCE;
QString strMIDISetup = "";
Expand Down Expand Up @@ -193,11 +193,11 @@ int main ( int argc, char** argv )
}

// JSON-RPC bind address ------------------------------------------------
if ( GetStringArgument ( argc, argv, i, "--jsonrpcbind", "--jsonrpcbind", strArgument ) )
if ( GetStringArgument ( argc, argv, i, "--jsonrpcbindip", "--jsonrpcbindip", strArgument ) )
{
strJsonRpcBindAddress = QString ( strArgument );
qInfo() << qUtf8Printable ( QString ( "- JSON-RPC binding to: %1" ).arg ( strJsonRpcBindAddress ) );
CommandLineOptions << "--jsonrpcbind";
strJsonRpcBindIP = QString ( strArgument );
qInfo() << qUtf8Printable ( QString ( "- JSON-RPC binding to: %1" ).arg ( strJsonRpcBindIP ) );
CommandLineOptions << "--jsonrpcbindip";
continue;
}

Expand Down Expand Up @@ -890,7 +890,7 @@ int main ( int argc, char** argv )
qWarning() << "- JSON-RPC: This interface is experimental and is subject to breaking changes even on patch versions "
"(not subject to semantic versioning) during the initial phase.";

pRpcServer = new CRpcServer ( pApp, strJsonRpcBindAddress, iJsonRpcPortNumber, strJsonRpcSecret );
pRpcServer = new CRpcServer ( pApp, strJsonRpcBindIP, iJsonRpcPortNumber, strJsonRpcSecret );
if ( !pRpcServer->Start() )
{
qCritical() << qUtf8Printable ( QString ( "- JSON-RPC: Server failed to start. Exiting." ) );
Expand Down Expand Up @@ -1082,7 +1082,7 @@ QString UsageArguments ( char** argv )
" --jsonrpcsecretfile\n"
" path to a single-line file which contains a freely\n"
" chosen secret to authenticate JSON-RPC users.\n"
" --jsonrpcbind optional network address to bind RPC server. Defaults to localhost.\n"
" --jsonrpcbindip optional network address to bind RPC server. Defaults to localhost.\n"
" -Q, --qos set the QoS value. Default is 128. Disable with 0\n"
" (see the Jamulus website to enable QoS on Windows)\n"
" -t, --notranslation disable translation (use English language)\n"
Expand Down
6 changes: 3 additions & 3 deletions src/rpcserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#include "global.h"
#include "rpcserver.h"

CRpcServer::CRpcServer ( QObject* parent, QString strBindAddress, int iPort, QString strSecret ) :
CRpcServer::CRpcServer ( QObject* parent, QString strBindIP, int iPort, QString strSecret ) :
QObject ( parent ),
strBindAddress ( strBindAddress ),
strBindIP ( strBindIP ),
iPort ( iPort ),
strSecret ( strSecret ),
pTransportServer ( new QTcpServer ( this ) )
Expand Down Expand Up @@ -61,7 +61,7 @@ bool CRpcServer::Start()
{
return false;
}
if ( pTransportServer->listen ( QHostAddress ( strBindAddress ), iPort ) )
if ( pTransportServer->listen ( QHostAddress ( strBindIP ), iPort ) )
{
qInfo() << qUtf8Printable ( QString ( "- JSON-RPC: Server started on %1:%2" )
.arg ( pTransportServer->serverAddress().toString() )
Expand Down
4 changes: 2 additions & 2 deletions src/rpcserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CRpcServer : public QObject
Q_OBJECT

public:
CRpcServer ( QObject* parent, QString strBindAddress, int iPort, QString secret );
CRpcServer ( QObject* parent, QString strBindIP, int iPort, QString secret );
virtual ~CRpcServer();

bool Start();
Expand All @@ -64,7 +64,7 @@ class CRpcServer : public QObject
static const int iErrUnauthenticated = 401;

private:
QString strBindAddress;
QString strBindIP;
int iPort;
QString strSecret;
QTcpServer* pTransportServer;
Expand Down

0 comments on commit 205cc4b

Please sign in to comment.