golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
583 B
39 lines
583 B
package rtsp |
|
|
|
import ( |
|
"net" |
|
) |
|
|
|
type Conn struct { |
|
c net.Conn |
|
} |
|
|
|
func NewConn(c net.Conn) *Conn { |
|
return &Conn{ |
|
c: c, |
|
} |
|
} |
|
|
|
func (c *Conn) Close() error { |
|
return c.c.Close() |
|
} |
|
|
|
func (c *Conn) RemoteAddr() net.Addr { |
|
return c.c.RemoteAddr() |
|
} |
|
|
|
func (c *Conn) ReadRequest() (*Request, error) { |
|
return requestDecode(c.c) |
|
} |
|
|
|
func (c *Conn) WriteRequest(req *Request) error { |
|
return requestEncode(c.c, req) |
|
} |
|
|
|
func (c *Conn) ReadResponse() (*Response, error) { |
|
return responseDecode(c.c) |
|
} |
|
|
|
func (c *Conn) WriteResponse(res *Response) error { |
|
return responseEncode(c.c, res) |
|
}
|
|
|