6.3.5. The wip_setOpts Function
The options supported by the wip_setOpts function, applied to a UDP are:
…
// The following documented option doesn’t work - using it causes - ERRLOG …/src/ch_udp.c:386: returned WIP_CERR_INVALID
WIP_COPT_PEER_ADDR wip_in_addr_t Address of the peer socket, as a 32 bits integer. default:0
// this option should be removed from the table - or give us the WIP source code so that we can figure out what options are valid
// the following option works fine:
WIP_COPT_PEER_STRADDR ascii* Address of the peer socket. If set to NULL on a pseudo connected UDP socket, remove the connection. default:0
// Thinking about the NULL functionality option of the string version precludes use of wip_in_addr_t (u32)
WIP_COPT_PEER_ADDR doesn’t have NULL or equivalent or at least it’s not documented.
Why have 2 ways of doing the same thing?
WIP_COPT_PEER_ADDR doesn’t work all the time - my code sets WIP_COPT_PEER_ADDR using wip_setOpts on the fly - in this use case using WIP_COPT_PEER_STRADDR works and WIP_COPT_PEER_ADDR doesn’t.
It’s either a WIP bug or documentation bug - for me I’d remove WIP_COPT_PEER_ADDR and change the doc
I’m just trying to save other poor developer an hours debugging - it’s bad (slow) enough debugging my own code using DS with out this kind issue cropping up
In some programming language, developer has to convert the ASCII representation into required data type everytime before calling, like:
c++ - long using inet_addr()
java - InetAddress using getByName()
OpenAT instead allow developer to use directly both u32 and string type for the address…