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)

748件の閲覧回数
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 返信

619件の閲覧回数
Carlos_Musich
NXP Employee
NXP Employee

Hi,

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

Regards,

Carlos

0 件の賞賛
返信