Listener: Task Destroy

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Listener: Task Destroy

ソリューションへジャンプ
1,548件の閲覧回数
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,093件の閲覧回数
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,093件の閲覧回数
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,093件の閲覧回数
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,093件の閲覧回数
Mike_d
Contributor IV

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

0 件の賞賛
返信
1,094件の閲覧回数
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 件の賞賛
返信