add local addr and remote addr function to session
This commit is contained in:
+5
-4
@@ -1,6 +1,7 @@
|
|||||||
package melody
|
package melody
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -220,11 +221,11 @@ func (s *Session) IsClosed() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// LocalAddr returns the local addr of the connection.
|
// LocalAddr returns the local addr of the connection.
|
||||||
func (s *session) LocalAddr() net.Addr {
|
func (s *Session) LocalAddr() net.Addr {
|
||||||
return conn.LocalAddr()
|
return s.conn.LocalAddr()
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoteAddr returns the remote addr of the connection.
|
// RemoteAddr returns the remote addr of the connection.
|
||||||
func (s *session) RemoteAddr() net.Addr {
|
func (s *Session) RemoteAddr() net.Addr {
|
||||||
return conn.RemoteAddr()
|
return s.conn.RemoteAddr()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user