Package Network - Palamecia/mint GitHub Wiki
The Network package provides the abstractions and transports used to build
networked applications in Mint.
It is organized around three main layers:
- The Network.Endpoint abstraction describes peer addresses and the protocol-specific information needed to reach them.
- The Network.Socket abstraction represents a transport endpoint for a specific protocol family such as TCP or UDP.
- The Network.Channel and Network.EventChannel classes expose message-based communication over a socket. The synchronous channel is appropriate for direct use, while the event channel integrates with the runtime scheduler for asynchronous I/O.
The package also provides protocol-specific client and server classes for layers 5 to 7 of the OSI model, together with polling and runtime integration helpers.
load network.poller
load network.sockets.tcp
load network.endpoints.ip
load network.protocols.http.client
if let client = Network.Http.Client(Network.TcpSocket()) {
client.onMessage = def (self, channel) {
sendToBrowser(self.read())
}
client.connect(Network.IpEndpoint(serverHost, serverPort))
let poller = Network.Poller()
poller.watch(client)
while running {
poller.poll()
}
client.close()
}
- Network.IpSocketOption
- Network.IpV4SocketOption
- Network.IpV6SocketOption
- Network.LocalSocketOption
- Network.PollEvent
- Network.SocketOption
- Network.TcpSocketOption
- Network.AsyncChannel
- Network.AsyncDataSerializer
- Network.AsyncDatagramSerializer
- Network.AsyncIpSocket
- Network.AsyncLocalSocket
- Network.AsyncServerSerializer
- Network.AsyncSocket
- Network.AsyncTcpSocket
- Network.AsyncTextSerializer
- Network.AsyncUdpSocket
- Network.Channel
- Network.DataSerializer
- Network.Datagram
- Network.DatagramSerializer
- Network.Endpoint
- Network.EventChannel
- Network.IpEndpoint
- Network.IpSocket
- Network.IpV4MulticastGroup
- Network.IpV4MulticastSourceGroup
- Network.IpV6MulticastGroup
- Network.LocalEndpoint
- Network.LocalSocket
- Network.PollDescriptor
- Network.Poller
- Network.ServerSerializer
- Network.Socket
- Network.SocketLinger
- Network.SocketTime
- Network.StdioEndpoint
- Network.StdioSocket
- Network.TcpSocket
- Network.TextSerializer
- Network.UdpSocket