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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

482 Views
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

Labels (1)
0 Kudos
Reply
1 Reply

353 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi,

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

Regards,

Carlos

0 Kudos
Reply