added full parameter set to pynorm.Session.setTxPort()

pull/68/head
bebopagogo 2022-07-02 17:07:23 -04:00
parent cc3a29b025
commit a1bb33c354
4 changed files with 15 additions and 15 deletions

View File

@ -63,20 +63,20 @@ extern const double NORM_DEFAULT_CONNECT_TIMEOUT;
NormSocketHandle NormOpen(NormInstanceHandle instance); NormSocketHandle NormOpen(NormInstanceHandle instance);
bool NormListen(NormSocketHandle normSocket, bool NormListen(NormSocketHandle normSocket,
UINT16 serverPort, UINT16 serverPort,
const char* groupAddr = NULL, const char* groupAddr = NULL,
const char* serverAddr = NULL); const char* serverAddr = NULL);
bool NormConnect(NormSocketHandle normSocket, bool NormConnect(NormSocketHandle normSocket,
const char* serverAddr, const char* serverAddr,
UINT16 serverPort, UINT16 serverPort,
UINT16 localPort = 0, UINT16 localPort = 0,
const char* groupAddr = NULL, const char* groupAddr = NULL,
NormNodeId clientId = NORM_NODE_ANY); NormNodeId clientId = NORM_NODE_ANY);
NormSocketHandle NormAccept(NormSocketHandle serverSocket, NormSocketHandle NormAccept(NormSocketHandle serverSocket,
NormNodeHandle clientNode, NormNodeHandle clientNode,
NormInstanceHandle instance = NORM_INSTANCE_INVALID); NormInstanceHandle instance = NORM_INSTANCE_INVALID);
void NormReject(NormSocketHandle serverSocket, void NormReject(NormSocketHandle serverSocket,

View File

@ -29,7 +29,7 @@ def main(argv):
(opts, args) = get_option_parser().parse_args(argv) (opts, args) = get_option_parser().parse_args(argv)
if len(args) != 1: if len(args) != 1:
print USAGE print(USAGE)
return 1 return 1
pipep = PipeParser(opts.pipe) pipep = PipeParser(opts.pipe)
@ -53,7 +53,7 @@ def main(argv):
except IndexError: except IndexError:
continue continue
pipep.reports.task_done() pipep.reports.task_done()
print "Exiting..." print("Exiting...")
# g.reset() # g.reset()
# g.close() # g.close()
# del g # del g

View File

@ -52,10 +52,10 @@ typedef uint32_t UINT32;
// is removed, the API shouldn't be considered final. // is removed, the API shouldn't be considered final.
#ifndef __cplusplus #ifndef __cplusplus
# include <stdbool.h> #include <stdbool.h>
# define DEFAULT(arg) #define DEFAULT(arg)
#else #else
# define DEFAULT(arg) = arg #define DEFAULT(arg) = arg
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -42,8 +42,8 @@ class Session(object):
def getNodeId(self): def getNodeId(self):
return libnorm.NormGetLocalNodeId(self) return libnorm.NormGetLocalNodeId(self)
def setTxPort(self, port): def setTxPort(self, txPort, enableReuse=False, txBindAddr=None):
libnorm.NormSetTxPort(self, port) libnorm.NormSetTxPort(self, txPort, enableReuse, txBindAddr)
def setRxPortReuse(self, enable, rxBindAddr=None, senderAddr=None, senderPort=0): def setRxPortReuse(self, enable, rxBindAddr=None, senderAddr=None, senderPort=0):
libnorm.NormSetRxPortReuse(self, enable, rxBindAddr.encode('utf-8'), senderAddr.encode('utf-8'), senderPort) libnorm.NormSetRxPortReuse(self, enable, rxBindAddr.encode('utf-8'), senderAddr.encode('utf-8'), senderPort)