51 lines
1.3 KiB
Go
51 lines
1.3 KiB
Go
|
package local_socket
|
||
|
|
||
|
import (
|
||
|
"net"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
// Read reads data from the connection.
|
||
|
func (s *LocalSocket) Read(data []byte) (int, error) {
|
||
|
return s.conn.Read(data)
|
||
|
}
|
||
|
|
||
|
// Write writes data to the connection.
|
||
|
func (s *LocalSocket) Write(data []byte) (int, error) {
|
||
|
return s.conn.Write(data)
|
||
|
}
|
||
|
|
||
|
// Close closes the connection.
|
||
|
func (s *LocalSocket) Close() error {
|
||
|
return s.conn.Close()
|
||
|
}
|
||
|
|
||
|
// LocalAddr returns the local network address.
|
||
|
// The Addr returned is shared by all invocations of LocalAddr, so
|
||
|
// do not modify it.
|
||
|
func (s *LocalSocket) LocalAddr() net.Addr {
|
||
|
return s.conn.LocalAddr()
|
||
|
}
|
||
|
|
||
|
// RemoteAddr returns the remote network address.
|
||
|
// The Addr returned is shared by all invocations of RemoteAddr, so
|
||
|
// do not modify it.
|
||
|
func (s *LocalSocket) RemoteAddr() net.Addr {
|
||
|
return s.conn.RemoteAddr()
|
||
|
}
|
||
|
|
||
|
// SetDeadline implements the Conn SetDeadline method.
|
||
|
func (s *LocalSocket) SetDeadline(t time.Time) error {
|
||
|
return s.conn.SetDeadline(t)
|
||
|
}
|
||
|
|
||
|
// SetReadDeadline implements the Conn SetReadDeadline method.
|
||
|
func (s *LocalSocket) SetReadDeadline(t time.Time) error {
|
||
|
return s.conn.SetReadDeadline(t)
|
||
|
}
|
||
|
|
||
|
// SetWriteDeadline implements the Conn SetWriteDeadline method.
|
||
|
func (s *LocalSocket) SetWriteDeadline(t time.Time) error {
|
||
|
return s.conn.SetWriteDeadline(t)
|
||
|
}
|