let rec loop() =
actor {
let! msg = mailbox.Receive()
fn state msg
return! loop()
}
loop()
type MyState = { X: int; Y: int }
let aref = spawn system "my-actor" <| fun mailbox ->
let rec loop state = actor {
let! msg = mailbox.Receive()
return! loop ({ state with Y = msg })
}
loop ({X = 1; Y = 2})
TcpClient
and UdpClient
call Socket.Bind
in their constructors on Mono, which makes it impossible to set socket options on them