Skip to content

Commit

Permalink
server_async: Permit to configure reuse_address/port
Browse files Browse the repository at this point in the history
  • Loading branch information
geaaru committed Nov 1, 2019
1 parent fbf480e commit c452277
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pyrad/server_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ def CreateReplyPacket(pkt, **attributes):

async def initialize_transports(self, enable_acct=False,
enable_auth=False, enable_coa=False,
addresses=None):
addresses=None, reuse_address=True,
reuse_port=True):

task_list = []

Expand All @@ -312,7 +313,7 @@ async def initialize_transports(self, enable_acct=False,
bind_addr = (addr, self.acct_port)
acct_connect = self.loop.create_datagram_endpoint(
protocol_acct,
reuse_address=True, reuse_port=True,
reuse_address=reuse_address, reuse_port=reuse_port,
local_addr=bind_addr
)
self.acct_protocols.append(protocol_acct)
Expand All @@ -331,7 +332,7 @@ async def initialize_transports(self, enable_acct=False,

auth_connect = self.loop.create_datagram_endpoint(
protocol_auth,
reuse_address=True, reuse_port=True,
reuse_address=reuse_address, reuse_port=reuse_port,
local_addr=bind_addr
)
self.auth_protocols.append(protocol_auth)
Expand All @@ -350,7 +351,7 @@ async def initialize_transports(self, enable_acct=False,

coa_connect = self.loop.create_datagram_endpoint(
protocol_coa,
reuse_address=True, reuse_port=True,
reuse_address=reuse_address, reuse_port=reuse_port,
local_addr=bind_addr
)
self.coa_protocols.append(protocol_coa)
Expand Down

0 comments on commit c452277

Please sign in to comment.