|
@@ -4,10 +4,12 @@
|
4
|
4
|
#include "cmCtx.h"
|
5
|
5
|
#include "cmMem.h"
|
6
|
6
|
#include "cmMallocDebug.h"
|
|
7
|
+#include "cmLinkedHeap.h"
|
7
|
8
|
#include "cmUdpPort.h"
|
8
|
9
|
#include "cmRtNet.h"
|
9
|
10
|
#include "cmTime.h"
|
10
|
11
|
#include "cmRtSysMsg.h"
|
|
12
|
+#include "cmText.h"
|
11
|
13
|
|
12
|
14
|
// flags for cmRtNetNode_t.flags;
|
13
|
15
|
enum
|
|
@@ -193,7 +195,7 @@ cmRtNetRC_t _cmRtNetCreateNode( cmRtNet_t* p, const cmChar_t* label, const cmCha
|
193
|
195
|
cmRtNetRC_t rc = kOkNetRC;
|
194
|
196
|
cmRtNetNode_t* np;
|
195
|
197
|
|
196
|
|
- if( label == NULL )
|
|
198
|
+ if( cmTextIsEmpty(label) )
|
197
|
199
|
return cmErrMsg(&p->err,kInvalidLabelNetRC,"A null or blank node label was encountered.");
|
198
|
200
|
|
199
|
201
|
if((np = _cmRtNetFindNode(p,label)) != NULL )
|
|
@@ -620,6 +622,12 @@ cmRtNetRC_t cmRtNetInitialize( cmRtNetH_t h, const cmChar_t* bcastAddr, const cm
|
620
|
622
|
if((rc = cmRtNetFinalize(h)) != kOkNetRC )
|
621
|
623
|
goto errLabel;
|
622
|
624
|
|
|
625
|
+ if( cmTextIsEmpty(bcastAddr) )
|
|
626
|
+ {
|
|
627
|
+ rc = cmErrMsg(&p->err,kInvalidArgNetRC,"The 'broadcast address' is not valid.");
|
|
628
|
+ goto errLabel;
|
|
629
|
+ }
|
|
630
|
+
|
623
|
631
|
// if this is the local node then initialze the local socket
|
624
|
632
|
if( cmUdpInit(p->udpH,port,kNonBlockingUdpFl | kBroadcastUdpFl,_cmRtNetRecv,p,NULL,0,p->udpRecvBufByteCnt,p->udpTimeOutMs) != kOkUdpRC )
|
625
|
633
|
{
|
|
@@ -647,6 +655,17 @@ cmRtNetRC_t cmRtNetInitialize( cmRtNetH_t h, const cmChar_t* bcastAddr, const cm
|
647
|
655
|
return rc;
|
648
|
656
|
}
|
649
|
657
|
|
|
658
|
+
|
|
659
|
+bool cmRtNetIsInitialized( cmRtNetH_t h )
|
|
660
|
+{
|
|
661
|
+ if( cmRtNetIsValid(h) == false )
|
|
662
|
+ return false;
|
|
663
|
+
|
|
664
|
+ cmRtNet_t* p = _cmRtNetHandleToPtr(h);
|
|
665
|
+ return p->localNode != NULL && cmTextIsNotEmpty(p->bcastAddr);
|
|
666
|
+}
|
|
667
|
+
|
|
668
|
+
|
650
|
669
|
cmRtNetRC_t cmRtNetRegisterEndPoint( cmRtNetH_t h, const cmChar_t* endPtLabel, unsigned endPtId )
|
651
|
670
|
{
|
652
|
671
|
cmRtNetRC_t rc = kOkNetRC;
|