Add comments and session
This commit is contained in:
parent
196e76e350
commit
89231f701b
@ -48,6 +48,10 @@ func (s *socket) Id() string {
|
|||||||
return s.id
|
return s.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *socket) Session() string {
|
||||||
|
return s.session
|
||||||
|
}
|
||||||
|
|
||||||
func (s *socket) Send(m *transport.Message) error {
|
func (s *socket) Send(m *transport.Message) error {
|
||||||
select {
|
select {
|
||||||
case <-s.closed:
|
case <-s.closed:
|
||||||
|
@ -20,15 +20,19 @@ type Tunnel interface {
|
|||||||
Listen(addr string) (Listener, error)
|
Listen(addr string) (Listener, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The listener provides similar constructs to the transport.Listener
|
||||||
type Listener interface {
|
type Listener interface {
|
||||||
Addr() string
|
Addr() string
|
||||||
Close() error
|
Close() error
|
||||||
Accept() (Conn, error)
|
Accept() (Conn, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Conn is a connection dialed or accepted which includes the tunnel id and session
|
||||||
type Conn interface {
|
type Conn interface {
|
||||||
// Specifies the tunnel id
|
// Specifies the tunnel id
|
||||||
Id() string
|
Id() string
|
||||||
|
// The session
|
||||||
|
Session() string
|
||||||
// a transport socket
|
// a transport socket
|
||||||
transport.Socket
|
transport.Socket
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user