Listener: Task Destroy

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Listener: Task Destroy

跳至解决方案
1,545 次查看
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?

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,090 次查看
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 项奖励
回复
4 回复数
1,090 次查看
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 项奖励
回复
1,090 次查看
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 项奖励
回复
1,090 次查看
Mike_d
Contributor IV

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

0 项奖励
回复
1,091 次查看
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 项奖励
回复