Skip to content

Commit

Permalink
Merge pull request #2 from yukityan/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
mike96265 authored Aug 1, 2019
2 parents 5dfcefb + d8f7a84 commit ac8f78c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kcp/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def ds_factory():
tunnel = protocol.tunnel
return tunnel.create_connection()

server = await asyncio.start_server(functools.partial(open_pipe, ds_factory=ds_factory), host=config.local_address,
server = await asyncio.start_server(functools.partial(open_pipe, ds_factory=ds_factory), host=config.local,
port=config.local_port)

logging.info("starting local at %s:%s", config.local, config.local_port)
Expand Down
4 changes: 3 additions & 1 deletion kcp/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ def cb(fut):

task = loop.create_task(self.create_connection(conv))
task.add_done_callback(cb)
self.accept_dict[conv] = task

def close(self, exc):
sessions = self.sessions
for session in sessions.values():
session.protocol.eof_received()
session.protocol.connection_lost(exc)
del sessions[session.conv]
sessions.clear()
self.accept_dict.clear()
del sessions
self.sessions = None

Expand Down
2 changes: 1 addition & 1 deletion kcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def ds_factory():

protocol = ServerDataGramHandlerProtocol(functools.partial(open_pipe, ds_factory=ds_factory))
await loop.create_datagram_endpoint(lambda: protocol, local_addr=(config.local, config.local_port))
logging.info("start server at %s:%s", config.local_address, config.local_port)
logging.info("start server at %s:%s", config.local, config.local_port)
updater.load_config(config)
updater.run()
for signame in {'SIGQUIT', 'SIGTERM'}:
Expand Down

0 comments on commit ac8f78c

Please sign in to comment.