Helios 2.0 IConnection Spec
Aaronontheweb opened this issue · comments
IConnection
- right now this term is used to mean two things:
- Literally the object that the app developer uses to interact with the Helios server (i.e. what gets created at the end of a
ClientBootstrap
orServerBootstrap
) and - Also the response channel that gets passed to any of the Helios event handlers.
Essentially any handle to a socket no matter what was an IConnection
in Helios 1.0.
Going forward, IConnection
is going to mean only item 1 - this is literally the handle a developer is going to use to start / stop their Helios client or server going forward. All of the
IConnection Capabilities
An IConnection will be responsible for the following things, after it's been built:
- start / stop the underlying transport - i.e. shutdown the socket or the socket listener.
- provide read access to
INode
/ address information - let the caller know what port / IP we're bound to. - allow the developer to change the writability of the transport - queue up writes until some magical thing has been done at the application level.
- expose a
WaitHandle
for forcing the app to run continuously until shutdown - make it easy for people to wait while the socket is open. - __expose the
IChannel
object that Helios clients need in order to write messages onto the network. Available only for client connections.