UDP finalizer

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

Hi,

The finalizer is called everytime when you call wip_close().

For my TCP server, I use the following setup,

socket = wip_TCPClientCreateOpts(serverIPAddr[tcp_index],

					serverPort[tcp_index],

					*tcp_evHandler[tcp_index],

					NULL,

					WIP_COPT_FINALIZER, wip_finaliser,

					WIP_COPT_REXMT_MAX, 5,

					WIP_COPT_REXMT_MAXCNT, 10,

					WIP_COPT_END);

This works fine without any problem and it always call the finalizer function when wip_close() is called.

Paul

I have the same issue in my application: TCP finalizers are fired successfully, but UDP - are not (using WIP.5.30.0.2040). I guess, there is a bug: either in WIP lib, or in documentation. It would be great to get any official confirmation from Sierra, though …

Then you need to contact them directly.

Like most manufacturers, they do not engage on their user forum. :angry: