Copyright | (c) 2018-2019 Commonwealth Scientific and Industrial Research Organisation |
---|---|
License | BSD3 |
Maintainer | [email protected], [email protected] |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Reflex.Backend.Socket
Description
Use socket
to wrap a network Socket
so that it sends out the
firings of an
, and fires any data that it
receives on another Event
t ByteString
.Event
t ByteString
Synopsis
- socket :: forall t m. (Reflex t, PerformEvent t m, PostBuild t m, TriggerEvent t m, MonadIO (Performable m), MonadIO m) => SocketConfig t -> m (Socket t)
- data SocketConfig t = SocketConfig {
- _scInitSocket :: Socket
- _scMaxRx :: Int
- _scSend :: Event t ByteString
- _scClose :: Event t ()
- data Socket t = Socket {
- _sReceive :: Event t ByteString
- _sOpen :: Event t ()
- _sClose :: Event t ()
- _sError :: Event t IOException
- scInitSocket :: forall t. Lens' (SocketConfig t) Socket
- scMaxRx :: forall t. Lens' (SocketConfig t) Int
- scSend :: forall t. Lens' (SocketConfig t) (Event t ByteString)
- scClose :: forall t. Lens' (SocketConfig t) (Event t ())
- sReceive :: forall t. Lens' (Socket t) (Event t ByteString)
- sOpen :: forall t. Lens' (Socket t) (Event t ())
- sClose :: forall t. Lens' (Socket t) (Event t ())
- sError :: forall t. Lens' (Socket t) (Event t IOException)
- module Reflex.Backend.Socket.Accept
- module Reflex.Backend.Socket.Connect
- module Reflex.Backend.Socket.Error
Documentation
socket :: forall t m. (Reflex t, PerformEvent t m, PostBuild t m, TriggerEvent t m, MonadIO (Performable m), MonadIO m) => SocketConfig t -> m (Socket t) Source #
Wire a socket into the FRP network. You will likely use this to
attach events to a socket that you just connected (from
connect
), or a socket that you just
accepted (from the _aAcceptSocket
event you got when you called
accept
).
Socket configuration
data SocketConfig t Source #
Holds the socket to wire into the FRP network, and events that drive it.
Constructors
SocketConfig | |
Fields
|
Socket output events
Events produced by an active socket.
Constructors
Socket | |
Fields
|
Lenses
SocketConfig
scInitSocket :: forall t. Lens' (SocketConfig t) Socket Source #
scSend :: forall t. Lens' (SocketConfig t) (Event t ByteString) Source #
Socket
Convenience re-exports
module Reflex.Backend.Socket.Accept
module Reflex.Backend.Socket.Error