RTCS_create(), where is RTCS_Destroy()?

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

RTCS_create(), where is RTCS_Destroy()?

ソリューションへジャンプ
1,359件の閲覧回数
CarlFST60L
Senior Contributor II

Do I just call ipcfg_task_destroy(); from my task exit handler and that will look after all recouces for a simple UDP socket connection setup something like this (in short summary):

 

error = RTCS_create();

error = ipcfg_init_device(IPCFG_default_enet_device, IPCFG_default_enet_address);

error = ipcfg_bind_dhcp_wait(0, TRUE, &ip_data);

error = ipcfg_get_ip(IPCFG_default_enet_device, &ip_data));

sock = socket(PF_INET, SOCK_DGRAM, 0);

error = bind(sock, &local_sin, sizeof(local_sin));

//TX/RX

for(;:smileywink:{

count = sendto(sock, my_TXbuffer, i, 0, &remote_sin, sizeof(sockaddr_in));

count = recvfrom(sock, my_RXbuffer, 256, 0, &remote_sin, &remote_len);    

}

 

If not, what recources do I have to free up in my exit handler? RTCS? Sockets? Bind?

 

Message Edited by CarlFST60L on 2010-01-31 04:23 AM
ラベル(1)
タグ(1)
0 件の賞賛
1 解決策
364件の閲覧回数
PetrM
Senior Contributor I

ipcfg_task_destroy() only destroys the task created by ipcfg_task_create() which only periodically checks the line status and rebinds ip address if necessary. This is not what you want in your example above.

 

Exit handler should at least shutdown/free up sockets created by the task.

It can optionally unbind ip address if not used anywhere else.

RTCS itself continues to work in separate tasks.

 

PetrM

 

元の投稿で解決策を見る

0 件の賞賛
1 返信
365件の閲覧回数
PetrM
Senior Contributor I

ipcfg_task_destroy() only destroys the task created by ipcfg_task_create() which only periodically checks the line status and rebinds ip address if necessary. This is not what you want in your example above.

 

Exit handler should at least shutdown/free up sockets created by the task.

It can optionally unbind ip address if not used anywhere else.

RTCS itself continues to work in separate tasks.

 

PetrM

 

0 件の賞賛