|
@@ -18,6 +18,10 @@
|
18
|
18
|
#define cmUdp_SYS_ERR (-1)
|
19
|
19
|
#define cmUdp_NULL_SOCK (-1)
|
20
|
20
|
|
|
21
|
+#ifndef HOST_NAME_MAX
|
|
22
|
+#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
|
|
23
|
+#endif
|
|
24
|
+
|
21
|
25
|
enum
|
22
|
26
|
{
|
23
|
27
|
kIsConnectedUdpFl = 0x01,
|
|
@@ -99,6 +103,9 @@ cmUdpRC_t _cmUdpFree( cmUdp_t* p )
|
99
|
103
|
cmUdpRC_t _cmUdpInitAddr( cmUdp_t* p, const char* addrStr, cmUdpPort_t portNumber, struct sockaddr_in* retAddrPtr )
|
100
|
104
|
{
|
101
|
105
|
memset(retAddrPtr,0,sizeof(struct sockaddr_in));
|
|
106
|
+
|
|
107
|
+ if( portNumber == kInvalidUdpPortNumber )
|
|
108
|
+ return cmErrMsg(&p->err,kInvalidPortNumbUdpRC,"The port number %i cannot be used.",kInvalidUdpPortNumber);
|
102
|
109
|
|
103
|
110
|
if( addrStr == NULL )
|
104
|
111
|
retAddrPtr->sin_addr.s_addr = htonl(INADDR_ANY);
|