ESP8266 TCP Keepalive

I have a built a TCP server that supports multiple clients, from time to time clients can drop off leaving the connection open. I am looking for a way to utilize TCP Keepalive in the Arduino so I can close the connection if the client drops off, has anyone implemented this. I found the ESP8266 has espconn_set_keepalive function, but I am not sure how to use it in the Arduino environment, has anyone used this or is there another way to implement Keepalive?