no
This commit is contained in:
parent
b78d98c3a2
commit
09378d3931
4 changed files with 10 additions and 7 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -25,3 +25,6 @@ pip-log.txt
|
|||
|
||||
#Mr Developer
|
||||
.mr.developer.cfg
|
||||
|
||||
#
|
||||
config.json
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"server":"localhost",
|
||||
"server_port":8388,
|
||||
"server":"asia.jinxing.me",
|
||||
"server_port":28388,
|
||||
"local_port":1080,
|
||||
"password":"barfoo!",
|
||||
"password":"x980barfoo!",
|
||||
"timeout":600,
|
||||
"method":"table"
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import select
|
|||
import logging
|
||||
import socket
|
||||
import errno
|
||||
import binascii
|
||||
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
|
@ -201,8 +202,8 @@ class IOHandler(BaseHandler):
|
|||
self._ios.real_write()
|
||||
|
||||
def handle_error(self, events):
|
||||
logging.error("handle_error fd(%s)", self._fd)
|
||||
raise IOLoopError("io error: %x" % events)
|
||||
logging.error("handle_error fd(%s), events: %s", self._fd, binascii.b2a_hex(events))
|
||||
self._ios.close()
|
||||
|
||||
|
||||
class SimpleCopyFileHandler(IOHandler):
|
||||
|
|
|
@ -204,14 +204,13 @@ class LeftTunnelHandler(BaseTunnelHandler):
|
|||
try:
|
||||
logging.info('connecting to remote %s:%d', addr, port)
|
||||
_start_time = time.time()
|
||||
# remote_socket = socket.create_connection((addr, port), G_CONFIG['timeout'])
|
||||
remote_socket = socket.socket()
|
||||
remote_socket.connect((addr, port))
|
||||
remote_socket.setblocking(0)
|
||||
logging.info('cost time: %d', time.time()-_start_time)
|
||||
except socket.error, e:
|
||||
# Connection refused
|
||||
logging.warn("connect_to_remote(): %s, args: %r", e, e.args)
|
||||
logging.warn(e)
|
||||
return None
|
||||
|
||||
remote_ts = TunnelStream(remote_socket)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue