import socket

socket.setdefaulttimeout(3)

s = socket.socket()

try:
	s.connect(("localhost", 123456))
except Exception, e:
	print "[-] Error = " + str(e)
import socket

socket.setdefaulttimeout(3)

s = socket.socket()

try:
	s.connect(("localhost", 123456))
except Exception, e:
	print "[-] Error = " + str(e)