Catch IOException
Added configuration file for Travis CI
Added missing closing of socket