diff --git a/src/iec61850/inc/iec61850_server.h b/src/iec61850/inc/iec61850_server.h index 9080a6b1..4672c718 100644 --- a/src/iec61850/inc/iec61850_server.h +++ b/src/iec61850/inc/iec61850_server.h @@ -113,7 +113,7 @@ IedServer_setFilestoreBasepath(IedServer self, const char* basepath); * \brief Start handling client connections * * \param self the instance of IedServer to operate on. - * \param tcpPort the TCP port the server is listening + * \param tcpPort the TCP port the server is listening (-1 for using the default MMS or secure MMS port) */ void IedServer_start(IedServer self, int tcpPort); @@ -134,7 +134,7 @@ IedServer_stop(IedServer self); * be called periodically. * * \param self the instance of IedServer to operate on. - * \param tcpPort the TCP port the server is listening + * \param tcpPort the TCP port the server is listening (-1 for using the default MMS or secure MMS port) */ void IedServer_startThreadless(IedServer self, int tcpPort); diff --git a/src/mms/iso_mms/server/mms_server.c b/src/mms/iso_mms/server/mms_server.c index 577590b9..5781812c 100644 --- a/src/mms/iso_mms/server/mms_server.c +++ b/src/mms/iso_mms/server/mms_server.c @@ -394,7 +394,10 @@ void MmsServer_startListeningThreadless(MmsServer self, int tcpPort) { IsoServer_setConnectionHandler(self->isoServer, isoConnectionIndicationHandler, (void*) self); - IsoServer_setTcpPort(self->isoServer, tcpPort); + + if (tcpPort != -1) + IsoServer_setTcpPort(self->isoServer, tcpPort); + IsoServer_startListeningThreadless(self->isoServer); }