add missing conn.go file
This commit is contained in:
68
conn.go
Normal file
68
conn.go
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Henry
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
package goSam
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Conn struct {
|
||||
RWC
|
||||
conn net.Conn
|
||||
}
|
||||
|
||||
func WrapConn(c net.Conn) *Conn {
|
||||
wrap := Conn{
|
||||
conn: c,
|
||||
}
|
||||
wrap.Reader = NewReadLogger("<", c)
|
||||
wrap.Writer = NewWriteLogger(">", c)
|
||||
wrap.RWC.c = c
|
||||
return &wrap
|
||||
}
|
||||
|
||||
func (c *Conn) LocalAddr() net.Addr {
|
||||
return c.conn.LocalAddr()
|
||||
}
|
||||
|
||||
func (c *Conn) RemoteAddr() net.Addr {
|
||||
return c.conn.RemoteAddr()
|
||||
}
|
||||
|
||||
func (c *Conn) SetDeadline(t time.Time) error {
|
||||
log.Println("WARNING: SetDeadline() not sure this works")
|
||||
return c.conn.SetDeadline(t)
|
||||
}
|
||||
|
||||
func (c *Conn) SetReadDeadline(t time.Time) error {
|
||||
log.Println("WARNING: SetReadDeadline() not sure this works")
|
||||
return c.conn.SetReadDeadline(t)
|
||||
}
|
||||
func (c *Conn) SetWriteDeadline(t time.Time) error {
|
||||
log.Println("WARNING: SetWriteDeadline() not sure this works")
|
||||
return c.conn.SetWriteDeadline(t)
|
||||
}
|
2
debian/changelog
vendored
2
debian/changelog
vendored
@ -3,7 +3,7 @@ golang-github-eyedeekay-gosam (0.3.2.1) bionic; urgency=medium
|
||||
* Get rid of the debug directory, just move it into the source
|
||||
* Get rid of the old example, just use the one in the README
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Fri, 18 May 2019 18:12:21 -0500
|
||||
-- idk <hankhill19580@gmail.com> Sat, 08 Dec 2019 19:11:41 -0500
|
||||
|
||||
golang-github-eyedeekay-gosam (0.3.2.0) bionic; urgency=medium
|
||||
|
||||
|
Reference in New Issue
Block a user