Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin implementation of 'netutil' module. #298

Open
2 tasks
evanlinjin opened this issue Apr 19, 2019 · 1 comment
Open
2 tasks

Begin implementation of 'netutil' module. #298

evanlinjin opened this issue Apr 19, 2019 · 1 comment

Comments

@evanlinjin
Copy link

evanlinjin commented Apr 19, 2019

Background

Currently, communication between manager-node and skywire-node is done via a rpc.Client to rpc.Server relationship. However, in the future, skywire-node will need to initiate communication with manager-node (e.g. for notifications, logging and Skywire App to Manager communication).

Description

The netutil module is to be a shared library to aid communication between Skywire services. Communication can be either via Transport (or higher level interfaces), or noise.Conn.

The first structure to be implemented is netutil.RPCDuplex. This structure implements an RPC Duplex connection via a single net.Conn implementation. In other words, both ends of the connection has a rpc.Server and a rpc.Client.

type RPCDuplex struct {
	net.Conn
	*rpc.Client
	*rpc.Server
}

func NewRPCDuplex(conn net.Conn) *RPCDuplex { /* ... */ }

// Serve serves the rpc.Server via net.Conn.
func (d *RPCDuplex) Serve() { /* ... */ }

// All the other members needed should be made available from the embedded structures.

Resources

Tasks

  • Implement RPCDuplex (as specified above).
  • Write tests using net.Pipe() and having two RPCDuplex instances communicate with one another.
@evanlinjin evanlinjin added this to To do in Skywire Mainnet via automation Apr 19, 2019
@evanlinjin
Copy link
Author

Assigned for @atang152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

1 participant