Hi,
I was just wondering if UDP sockets/channel fire the finalizer function when closed (using WIP 5.30)?
I use both TCP and UDP sockets in my application and the finalizer function works successfully on the TCP sockets, but doesn’t seem to fire for UDP. The manual suggest it will, but only talks about channels in general.
I create the socket like this:
//UDP creation
socketA = wip_UDPCreateOpts ( WIP_UDPEventHandler, NULL,
WIP_COPT_FINALIZER, Channel_finalizer,
WIP_COPT_PORT, Config.RemotePort_A,
WIP_COPT_END)) != NULL)
//TCP creation
socketA = wip_TCPClientCreateOpts(RemoteIPStr, RemotePort, WIP_TCPSocketHandler, NULL,
WIP_COPT_FINALIZER, Channel_finalizer,
WIP_COPT_END)) != NULL)
The finalizer looks like this:
static void Channel_finalizer( void *ctx )
{
DebugMsg("finalization msg: the socket has now been completely released\n");
GPRSFlowActive = FALSE;
}
Just to remove confusion, the application works in one mode only, so for simplicity I have not shown the switch statement used to control which one is created.
Yes I do use a wip_close(socketA) elsewhere in the program and it is being called.
If the finalizer isn’t supposed to get called that I assume that the UDP socket is released instantly?
If it is supposed to be called then what have I missed or got wrong?
Thanks,
Ross