fixed socket.error exception, fixed ip passed by sys.argv[1] issue