add socket error-handling. Closes #114