Adding callback for timeout,error and close

Signed-off-by: Vivek Goel <goelvivek2011@gmail.com>
Update README.md
Merge pull request #9 from goelvivek/master

Adding callback for timeout