Listener: Task Destroy

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Listener: Task Destroy

Jump to solution
904 Views
Mike_d
Contributor IV

If I stop the dhcp server task with _task_destroy() the listener seems to be left open.  How can I make sure ALL resources are released when killing a listener task?

Labels (1)
Tags (1)
0 Kudos
1 Solution
449 Views
PetrM
Senior Contributor I

I'm not sure if RTCS alows to send dummy "unblock" messages...

Well, there's an option to pass RTCS_MSG_NONBLOCK flag to recvfrom() function and loop over it with some _time_delay(ms).

 

PetrM

View solution in original post

0 Kudos
4 Replies
449 Views
PetrM
Senior Contributor I

This is a bad design, the server is not supposed to quit.

The right way is to add the functionality into the server task - as a reaction on some message or event, shutdown the socket, release resources and return.

 

PetrM

 

0 Kudos
449 Views
netra
Contributor IV

I am facing the same problem can u tell me how to  release the resource .

In while (1) loop , I am shutting down the socket and trying to create the socket and it is throwing error in bind().

The error code is 0x1633.

Thanks in advance

Netra

0 Kudos
449 Views
Mike_d
Contributor IV

What if the task is blocking with recvfrom?  Can I do something to get it to return?

0 Kudos
450 Views
PetrM
Senior Contributor I

I'm not sure if RTCS alows to send dummy "unblock" messages...

Well, there's an option to pass RTCS_MSG_NONBLOCK flag to recvfrom() function and loop over it with some _time_delay(ms).

 

PetrM

0 Kudos