Skip to content

Commit dbc1f71

Browse files
committed
Copy Netty's DEFAULT_CONNECT_TIMEOUT
We already do the same for the default shutdown timeout and it's probably not gonna change a lot anyway ;-)
1 parent 8412070 commit dbc1f71

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/aleph/netty.clj

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
EpollEventLoopGroup
3939
EpollServerSocketChannel
4040
EpollSocketChannel)
41-
(io.netty.channel.embedded
42-
EmbeddedChannel)
4341
(io.netty.channel.group
4442
ChannelGroup
4543
DefaultChannelGroup)
@@ -195,6 +193,11 @@
195193
"Default timeout in seconds to wait for graceful shutdown complete"
196194
15)
197195

196+
(def ^:const default-connect-timeout
197+
"Netty's default connect timeout."
198+
;; io.netty.channel.DefaultChannelConfig/DEFAULT_CONNECT_TIMEOUT
199+
30000)
200+
198201
(def ^:const ^:no-doc byte-array-class (Class/forName "[B"))
199202

200203
#_
@@ -1518,14 +1521,6 @@
15181521
(ssl-handler ch ssl-ctx))))
15191522
(pipeline-builder p))))
15201523

1521-
(def ^:const
1522-
default-connect-timeout
1523-
"Netty's default connect timeout."
1524-
;; This hack is necessary due to io.netty.channel.DefaultChannelConfig/DEFAULT_CONNECT_TIMEOUT
1525-
;; being private.
1526-
(with-open [c (EmbeddedChannel.)]
1527-
(.getConnectTimeoutMillis (.config c))))
1528-
15291524
(defn ^:no-doc create-client-chan
15301525
"Returns a deferred containing a new Channel.
15311526

0 commit comments

Comments
 (0)