860ae9a024
This is a rework of some parts of the API to make connection management for applications more sane and reliable. - The RicochetService interface is split into the ServiceHandler and ConnectionHandler interfaces. ServiceHandler is implemented by the application to handle inbound connections to a listener. ConnectionHandler is implemented to handle events for a single OpenConnection. Handler instances should no longer be shared for different listeners or connections. - Instead of automatically starting a processConnection goroutine, the application is now responsible for calling OpenConnection.Process in a goroutine to act on the connection. This function blocks until the connection is closed. This change allows a better application pattern for setting the handler of a connection and reacting to connection loss. - It is no longer necessary to have started a listener in order to make outbound connections. - The Ricochet type is removed, because it no longer served any purpose, and this avoids having any shared state between different listeners or connections. |
||
---|---|---|
.. | ||
main.go |