Merge pull request #1916 from nanonyme/keepalive

Properly set keepalive time