network - Palamecia/mint GitHub Wiki
Module network
Description
This module provides the core abstractions used to interact with a network.
It is organized around three main layers:
- The Network.Endpoint abstraction describes a network peer address and the protocol-specific information required to reach it.
- 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 suitable for direct operation, while the event channel integrates with the runtime scheduler for asynchronous I/O.
The module also provides protocol-specific client and server classes for layers 5 to 7 of the OSI model, such as HTTP and JSON-RPC, together with polling and scheduler 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()
}
Packages
Enums
- Network.IpSocketOption
- Network.IpV4SocketOption
- Network.IpV6SocketOption
- Network.LocalSocketOption
- Network.PollEvent
- Network.Socket.IOStatus
- Network.Socket.State
- Network.SocketOption
- Network.TcpSocketOption
Classes
- Network.AsyncChannel
- Network.AsyncDataSerializer
- Network.AsyncDatagramSerializer
- Network.AsyncIpSocket
- Network.AsyncLocalSocket
- Network.AsyncLocalSocket.AcceptOperation
- Network.AsyncLocalSocket.ConnectOperation
- Network.AsyncLocalSocket.ReadOperation
- Network.AsyncLocalSocket.ReadSomeOperation
- Network.AsyncLocalSocket.WriteOperation
- Network.AsyncServerSerializer
- Network.AsyncSocket
- Network.AsyncTcpSocket
- Network.AsyncTcpSocket.AcceptOperation
- Network.AsyncTcpSocket.ConnectOperation
- Network.AsyncTcpSocket.ReadOperation
- Network.AsyncTcpSocket.ReadSomeOperation
- Network.AsyncTcpSocket.WriteOperation
- Network.AsyncTextSerializer
- Network.AsyncUdpSocket
- Network.AsyncUdpSocket.ReadFromOperation
- Network.AsyncUdpSocket.ReadOperation
- Network.AsyncUdpSocket.WriteOperation
- Network.AsyncUdpSocket.WriteToOperation
- Network.Channel
- Network.DataSerializer
- Network.Datagram
- Network.DatagramSerializer
- Network.Endpoint
- Network.EventChannel
- Network.EventChannel.DataQueue
- Network.Ftp.Client
- Network.Http.AbstractRequestHandler
- Network.Http.AsyncClient
- Network.Http.AsyncRequestHandler
- Network.Http.AsyncSerializer
- Network.Http.AsyncServer
- Network.Http.AsyncStaticResolver
- Network.Http.Client
- Network.Http.ClientConfiguration
- Network.Http.Message
- Network.Http.RequestHandler
- Network.Http.Resolver
- Network.Http.Router
- Network.Http.Serializer
- Network.Http.Server
- Network.Http.ServerConfiguration
- Network.Http.StaticResolver
- Network.IpEndpoint
- Network.IpSocket
- Network.IpV4MulticastGroup
- Network.IpV4MulticastSourceGroup
- Network.IpV6MulticastGroup
- Network.JsonRpc.AbstractRequestHandler
- Network.JsonRpc.AsyncClient
- Network.JsonRpc.AsyncRequestHandler
- Network.JsonRpc.AsyncSerializer
- Network.JsonRpc.AsyncServer
- Network.JsonRpc.Client
- Network.JsonRpc.ClientConfiguration
- Network.JsonRpc.Exception
- Network.JsonRpc.Message
- Network.JsonRpc.RequestHandler
- Network.JsonRpc.Serializer
- Network.JsonRpc.Server
- Network.JsonRpc.ServerConfiguration
- 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