Issue
I tried
val socket = aSocket(ActorSelectorManager(Dispatchers.IO)).tcp().configure {
socketTimeout = 1000
}.connect("127.0.0.1", 2323)
I can set other values like this but not the timeout. It's listed here TCPClientSocketOptions
Solution
The socketTimeout property is an extension of TCPClientSocketOptions as you said, but the scope from configure provides only SocketOptions. In order to correctly configure the TCP socket, you can specify the socketTimeout property when calling the connect function, like so:
val socket = aSocket(ActorSelectorManager(Dispatchers.IO))
.tcp()
.connect("127.0.0.1", 2323) {
socketTimeout = 1000
}
Answered By - Halex
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.