Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Lightbug HTTP (Linux)",
"image": "ghcr.io/prefix-dev/pixi:latest",
"postCreateCommand": "apt-get update && apt-get install -y git && pixi install",
"forwardPorts": [8080],
"customizations": {
"vscode": {
"extensions": ["modular-mojotools.vscode-mojo"]
}
}
}
13 changes: 5 additions & 8 deletions lightbug_http/connection.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,11 @@ struct ListenConfig:
except socket_err:
raise SocketCreationError()

@parameter
# TODO: do we want to add SO_REUSEPORT on linux? Doesn't work on some systems
if CompilationTarget.is_macos():
try:
socket.set_socket_option(SocketOption.SO_REUSEADDR, 1)
except sockopt_err:
# Socket option failure is not fatal, just continue
pass
try:
socket.set_socket_option(SocketOption.SO_REUSEADDR, 1)
except sockopt_err:
# Socket option failure is not fatal, just continue
pass

var addr = TCPAddr[network](ip=local.host^, port=local.port)
var bind_success = False
Expand Down