X-Git-Url: http://www.git.cypherpunks.ru/?p=ucspi.git;a=blobdiff_plain;f=conn.go;h=7a6ac4227f90b8ad8ab2882ebb3736489fecab61;hp=ad9c697251a7758754aee4dc90bdd481f4d50e2e;hb=16b21a11cabc2846be21d3214664c6deda174ea2;hpb=cfdc20a8225fdcbc63e52f156af6529c984bdddb diff --git a/conn.go b/conn.go index ad9c697..7a6ac42 100644 --- a/conn.go +++ b/conn.go @@ -26,14 +26,14 @@ import ( var aLongTimeAgo = time.Unix(1, 0) -type UCSPIAddr struct { +type Addr struct { ip string port string } -func (addr *UCSPIAddr) Network() string { return "tcp" } +func (addr *Addr) Network() string { return "tcp" } -func (addr *UCSPIAddr) String() string { return addr.ip + ":" + addr.port } +func (addr *Addr) String() string { return addr.ip + ":" + addr.port } type Conn struct { R *os.File @@ -70,11 +70,11 @@ func (conn *Conn) Close() error { } func (conn *Conn) LocalAddr() net.Addr { - return &UCSPIAddr{ip: os.Getenv("TCPLOCALIP"), port: os.Getenv("TCPLOCALPORT")} + return &Addr{ip: os.Getenv("TCPLOCALIP"), port: os.Getenv("TCPLOCALPORT")} } func (conn *Conn) RemoteAddr() net.Addr { - return &UCSPIAddr{ip: os.Getenv("TCPREMOTEIP"), port: os.Getenv("TCPREMOTEPORT")} + return &Addr{ip: os.Getenv("TCPREMOTEIP"), port: os.Getenv("TCPREMOTEPORT")} } func (conn *Conn) SetDeadline(t time.Time) error {