This module provides methods to connect to an OpenFlow control server, and send and receive messages to the server.
- data ClientHandle
- connectToController :: HostName -> PortID -> IO ClientHandle
- connectToHandles :: Handle -> Handle -> IO ClientHandle
- closeClient :: ClientHandle -> IO ()
- receiveControlMessage :: ClientHandle -> IO (Maybe (TransactionID, CSMessage))
- sendMessage :: ClientHandle -> (TransactionID, SCMessage) -> IO ()
- flushClient :: ClientHandle -> IO ()
Documentation
data ClientHandle Source
Abstract type representing the state of the connection to the control server.
connectToController :: HostName -> PortID -> IO ClientHandleSource
Established a connection to the control server with the given HostName
and PortID
and returns its ClientHandle
.
connectToHandles :: Handle -> Handle -> IO ClientHandleSource
Creates a ClientHandle
based on a handle to read from and one to write to.
closeClient :: ClientHandle -> IO ()Source
Close client, closing read and write handles.
receiveControlMessage :: ClientHandle -> IO (Maybe (TransactionID, CSMessage))Source
Blocks until a new control message arrives or the connection is terminated, in which
the return value is Nothing
.
sendMessage :: ClientHandle -> (TransactionID, SCMessage) -> IO ()Source
Sends a message to the controller.
flushClient :: ClientHandle -> IO ()Source