how to change keepalive time for every socket in frdmk64 (KDS 2.0)

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

how to change keepalive time for every socket in frdmk64 (KDS 2.0)

745 次查看
sudhakarp
Contributor V

hi,

i tried following steps

client_sock= accept(conn_sock, &remote_sin, &remote_addrlen);

     option =60000;//for 1 minute

          retval = setsockopt(client_sock, SOL_TCP, OPT_KEEPALIVE,&option, sizeof(option));    

          if (retval != RTCS_OK)

          {

              fputs("Fatal Error: Unable to set socket options.", stderr);

              _task_block();

          }

but after 1MINUTE its not disconnect the connection. still connection was there. why?. actually i want after some time the connection should shutdown if no data transfer between particular time. if i am doing anything wrong just correct me.

regards,

sudhakar p

标签 (1)
0 项奖励
回复
1 回复

616 次查看
Carlos_Musich
NXP Employee
NXP Employee

Hi,

Please see answer here:how to set keep alive timeout for socket(FRDMk64)

Regards,

Carlos

0 项奖励
回复