From 89231f701b0aaf3bbc1f4d59482939391f104c94 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Wed, 10 Jul 2019 18:26:11 +0100 Subject: [PATCH] Add comments and session --- network/tunnel/socket.go | 4 ++++ network/tunnel/tunnel.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/network/tunnel/socket.go b/network/tunnel/socket.go index 96d16567..b1c55797 100644 --- a/network/tunnel/socket.go +++ b/network/tunnel/socket.go @@ -48,6 +48,10 @@ func (s *socket) Id() string { return s.id } +func (s *socket) Session() string { + return s.session +} + func (s *socket) Send(m *transport.Message) error { select { case <-s.closed: diff --git a/network/tunnel/tunnel.go b/network/tunnel/tunnel.go index 60ad0f25..92b279b7 100644 --- a/network/tunnel/tunnel.go +++ b/network/tunnel/tunnel.go @@ -20,15 +20,19 @@ type Tunnel interface { Listen(addr string) (Listener, error) } +// The listener provides similar constructs to the transport.Listener type Listener interface { Addr() string Close() error Accept() (Conn, error) } +// Conn is a connection dialed or accepted which includes the tunnel id and session type Conn interface { // Specifies the tunnel id Id() string + // The session + Session() string // a transport socket transport.Socket }