cmUdpPort.h/c: Added kBroadcastUdpFl option.
This commit is contained in:
parent
44900567b8
commit
76258fe7e2
12
cmUdpPort.c
12
cmUdpPort.c
@ -256,6 +256,18 @@ cmUdpRC_t cmUdpInit(
|
||||
|
||||
}
|
||||
|
||||
// if broadcast option was requested.
|
||||
if( cmIsFlag(flags,kBroadcastUdpFl) )
|
||||
{
|
||||
int bcastFl = 1;
|
||||
if( setsockopt( p->sockH, SOL_SOCKET, SO_BROADCAST, &bcastFl, sizeof(bcastFl) ) == cmUdp_SYS_ERR )
|
||||
{
|
||||
rc = cmErrSysMsg(&p->err,kSockOptSetFailUdpRC,errno, "Attempt to set the socket broadcast attribute failed." );
|
||||
goto errLabel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( recvBufByteCnt != 0 )
|
||||
p->tempBuf = cmMemAlloc(char,recvBufByteCnt );
|
||||
|
||||
|
@ -41,7 +41,8 @@ extern "C" {
|
||||
{
|
||||
kNonBlockingUdpFl = 0x00,
|
||||
kBlockingUdpFl = 0x01,
|
||||
kNoQueueUdpFl = 0x02
|
||||
kNoQueueUdpFl = 0x02,
|
||||
kBroadcastUdpFl = 0x04
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user