The problem of error handling for socket is fixed.