Skip to content

Commit 7b3f55c

Browse files
committed
chore: Set reuseAddr by default for undertow.
1 parent 78031f7 commit 7b3f55c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cask/src/cask/main/Main.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import io.undertow.Undertow
1010
import io.undertow.server.{HttpHandler, HttpServerExchange}
1111
import io.undertow.server.handlers.BlockingHandler
1212
import io.undertow.util.HttpString
13+
import org.xnio.Options
1314

1415
import scala.concurrent.ExecutionContext
1516

@@ -65,6 +66,9 @@ abstract class Main{
6566
if (!verbose) Main.silenceJboss()
6667
val server = Undertow.builder
6768
.addHttpListener(port, host)
69+
.setSocketOption(Options.REUSE_ADDRESSES, true)
70+
.setSocketOption(Options.TCP_NODELAY, true)
71+
.setSocketOption(Options.USE_DIRECT_BUFFERS, true)
6872
.setHandler(defaultHandler)
6973
.build
7074
server.start()

0 commit comments

Comments
 (0)