From a1bb33c3540b248f0bf2152a9ac01ee52c32c0ef Mon Sep 17 00:00:00 2001 From: bebopagogo Date: Sat, 2 Jul 2022 17:07:23 -0400 Subject: [PATCH] added full parameter set to pynorm.Session.setTxPort() --- examples/normSocket.h | 16 ++++++++-------- examples/python/debugStats.py | 4 ++-- include/normApi.h | 6 +++--- src/pynorm/session.py | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/normSocket.h b/examples/normSocket.h index 136a5fb..481e6c6 100644 --- a/examples/normSocket.h +++ b/examples/normSocket.h @@ -63,20 +63,20 @@ extern const double NORM_DEFAULT_CONNECT_TIMEOUT; NormSocketHandle NormOpen(NormInstanceHandle instance); -bool NormListen(NormSocketHandle normSocket, - UINT16 serverPort, +bool NormListen(NormSocketHandle normSocket, + UINT16 serverPort, const char* groupAddr = NULL, - const char* serverAddr = NULL); + const char* serverAddr = NULL); -bool NormConnect(NormSocketHandle normSocket, - const char* serverAddr, - UINT16 serverPort, +bool NormConnect(NormSocketHandle normSocket, + const char* serverAddr, + UINT16 serverPort, UINT16 localPort = 0, const char* groupAddr = NULL, NormNodeId clientId = NORM_NODE_ANY); -NormSocketHandle NormAccept(NormSocketHandle serverSocket, - NormNodeHandle clientNode, +NormSocketHandle NormAccept(NormSocketHandle serverSocket, + NormNodeHandle clientNode, NormInstanceHandle instance = NORM_INSTANCE_INVALID); void NormReject(NormSocketHandle serverSocket, diff --git a/examples/python/debugStats.py b/examples/python/debugStats.py index 17613c0..1bc1b50 100755 --- a/examples/python/debugStats.py +++ b/examples/python/debugStats.py @@ -29,7 +29,7 @@ def main(argv): (opts, args) = get_option_parser().parse_args(argv) if len(args) != 1: - print USAGE + print(USAGE) return 1 pipep = PipeParser(opts.pipe) @@ -53,7 +53,7 @@ def main(argv): except IndexError: continue pipep.reports.task_done() - print "Exiting..." + print("Exiting...") # g.reset() # g.close() # del g diff --git a/include/normApi.h b/include/normApi.h index 41e71ed..8894ba4 100644 --- a/include/normApi.h +++ b/include/normApi.h @@ -52,10 +52,10 @@ typedef uint32_t UINT32; // is removed, the API shouldn't be considered final. #ifndef __cplusplus -# include -# define DEFAULT(arg) +#include +#define DEFAULT(arg) #else -# define DEFAULT(arg) = arg +#define DEFAULT(arg) = arg #endif #ifdef __cplusplus diff --git a/src/pynorm/session.py b/src/pynorm/session.py index 5cf7e34..c100277 100644 --- a/src/pynorm/session.py +++ b/src/pynorm/session.py @@ -42,8 +42,8 @@ class Session(object): def getNodeId(self): return libnorm.NormGetLocalNodeId(self) - def setTxPort(self, port): - libnorm.NormSetTxPort(self, port) + def setTxPort(self, txPort, enableReuse=False, txBindAddr=None): + libnorm.NormSetTxPort(self, txPort, enableReuse, txBindAddr) def setRxPortReuse(self, enable, rxBindAddr=None, senderAddr=None, senderPort=0): libnorm.NormSetRxPortReuse(self, enable, rxBindAddr.encode('utf-8'), senderAddr.encode('utf-8'), senderPort)