Skip to content

Commit

Permalink
Add configuration to enable new connections by default. (facebookrese…
Browse files Browse the repository at this point in the history
  • Loading branch information
0mdc authored and dannymcy committed Jun 26, 2024
1 parent b523e5e commit 99dbc18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def __init__(self, networking_config) -> None:
self._connection_record_queue: Queue[ConnectionRecord] = Queue()
self._disconnection_record_queue: Queue[DisconnectionRecord] = Queue()
self._kick_signal_queue: Queue[int] = Queue()
self._allow_new_connections = Value("b", False)

self._allow_new_connections = Value(
"b", networking_config.enable_connections_by_default
)

def enable_new_connections(self, enabled: bool):
"""Signal the networking process whether it should accept new connections."""
Expand Down
3 changes: 3 additions & 0 deletions habitat-hitl/habitat_hitl/config/hitl_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ habitat_hitl:
# Number of accepted concurrent clients (multiplayer if higher than one). All connections beyond this count will be rejected. Beware that this can be different from the agent count.
max_client_count: 1

# Accept incoming connections by default. If disabled, connections must be activated using InterprocessRecord.enable_new_connections().
enable_connections_by_default: True

# We'll listen for incoming client connections at this port.
port: 8888

Expand Down

0 comments on commit 99dbc18

Please sign in to comment.