exposed base net.Conn to interface

This commit is contained in:
Josh Baker 2017-02-09 10:32:15 -07:00
parent 6f1afba017
commit 8b15dea700
1 changed files with 5 additions and 0 deletions

View File

@ -88,6 +88,8 @@ type Conn interface {
// PeekPipeline returns all commands in current pipeline, if any.
// The commands remain in the pipeline.
PeekPipeline() []Command
// NetConn returns the base net.Conn connection
NetConn() net.Conn
}
// NewServer returns a new Redcon server configured on "tcp" network net.
@ -309,6 +311,9 @@ func (c *conn) ReadPipeline() []Command {
func (c *conn) PeekPipeline() []Command {
return c.cmds
}
func (c *conn) NetConn() net.Conn {
return c.conn
}
// BaseWriter returns the underlying connection writer, if any
func BaseWriter(c Conn) *Writer {