ยค openSocketF

Sockets

Types

openSocketF :: FudgetIO f => Host -> Port -> (Socket -> f b ho) -> f b ho

Synopsis

openSocketF host port fudget

type Host = String
type Port = Int

Description

openSocketF creates a (client) socket and connects it to another socket (a server). If the socket can not be created, or the connection can not be established, the program is terminated with an error message.

Arguments

host :: Host
Host to connect to.
port :: Port
Port number on the given host.
fudget :: Socket -> f b ho
A fudget, e.g., transceiverF, that uses the created socket.

Example

 openSocketF "news" 119 transceiverF

See Also

Communicating via sockets: transceiverF et al.

Creating passive sockets: openLSocketF.

Creating a socket with error handling: openSocketErrF.