You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have basic TCP actors. I'd like to have more functionality. I've been pondering the design for quite some time but haven't really reached a conclusion on something that meets all my requirements.
Requirements:
support happy eyeball, which is about connecting to a host name with the quickest possible transport
for example, we want to connect to example.com, like so TCPConnection("example.com", 80", ...)
DNS resolves example.com, for both A and AAAA
we get both an IPv4 and an IPv6 address
we start connecting to both IPv4 and IPv6 at the same time
whichever connection establishes first is used, the other is discarded
support reconnection in a simple way
packets are dropped, it's every day life on the Internet, yet most socket interfaces are very low level - sockets cannot be reused, forcing user to redo everything
for example, it is NOT enough to connect once and then pass around a socket, the application must also have address, port etc, so it can reconnect
explicit reconnect, but maybe also some option of automatic reconnect?
work well with capabilities based security
we have capability based security, meaning we delegate access to things from a higher privilege actor to a semi-trusted actor, mostly by passing something in the Auth chain, like WorldAuth -> NetAuth -> TCPAuth -> TCPConnectAuth
for example, main actor has WorldAuth, creates TCPConnectAuth and passes to HTTPClient actor, which is then able to initialize a TCP connection but cannot do other things, like shut down the system
but we can also potentially create the resource itself in the higher privilege actor and pass the resource to the semi-trusted actor
for example, main actor directly created TCPConnection and passes to HTTPCLient
but this requires that HTTPClient actor, which now owns the TCPConnection can do reconnect, otherwise the connection quickly becomes useless
the alternative, soliciting help from the privileged actor to perform the reconnect, does not seem like it would lead to nice code
reusable for many TCP connections
like our base TCP client we have now are for plain TCP
but we should have the same design pattern and preferably implementation be reused for OpenSSL or similar protocol that rides on top of TCP
OpenSSL needs happy eyeballs too!
0 overhead
for example, an SSL actor should directly talk to sockets, not be layered on top of a TCP actor
we don't want the SSL actor to sit on top of a TCP actor, which would introduce extra data passing, it would imply two worker thread schedulings etc
0 overhead also means we cannot implement happy eyeballs using 2 levels of actors
but is it possible with mixin classes?
Thoughts:
multiple actors, perhaps using mixins or so, to cater to different use cases
higher level, simple to use, TCP actor
for example does automatic reconnect with resonable backoff
this should fit 90% of use cases
one more raw & low level TCP actor
The text was updated successfully, but these errors were encountered:
We have basic TCP actors. I'd like to have more functionality. I've been pondering the design for quite some time but haven't really reached a conclusion on something that meets all my requirements.
Requirements:
example.com
, like soTCPConnection("example.com", 80", ...)
example.com
, for both A and AAAAHTTPClient
actor, which is then able to initialize a TCP connection but cannot do other things, like shut down the systemTCPConnection
and passes toHTTPCLient
HTTPClient
actor, which now owns theTCPConnection
can do reconnect, otherwise the connection quickly becomes uselessThoughts:
The text was updated successfully, but these errors were encountered: