Fix type error
Send ping and use pong to calculate timeout
Merge pull request #22 from rodms10/type-error

Fix type error and use pong for timeout.