Skip to content

Commit

Permalink
problem: missing heartbeat options
Browse files Browse the repository at this point in the history
  • Loading branch information
somdoron committed Apr 25, 2020
1 parent a330c91 commit 22b0de0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/FsNetMQ/Options.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,23 @@ let setLinger (socket:Socket) (value:int<milliseconds>) =

let setHelloMessage (socket:Socket) (value:byte[]) =
socket.Socket.Options.HelloMessage <- value

let heartbeatInterval (socket:Socket) =
(int socket.Socket.Options.HeartbeatInterval.TotalMilliseconds) * 1<milliseconds>

let setHeartbeatInterval (socket:Socket) (value:int<milliseconds>) =
socket.Socket.Options.HeartbeatInterval <- TimeSpan.FromMilliseconds (float value)

let heartbeatTtl (socket:Socket) =
(int socket.Socket.Options.HeartbeatTtl.TotalMilliseconds) * 1<milliseconds>

let setHeartbeatTtl (socket:Socket) (value:int<milliseconds>) =
socket.Socket.Options.HeartbeatTtl <- TimeSpan.FromMilliseconds (float value)

let heartbeatTimeout (socket:Socket) =
(int socket.Socket.Options.HeartbeatTimeout.TotalMilliseconds) * 1<milliseconds>

let setHeartbeatTimeout (socket:Socket) (value:int<milliseconds>) =
socket.Socket.Options.HeartbeatTimeout <- TimeSpan.FromMilliseconds (float value)


0 comments on commit 22b0de0

Please sign in to comment.