Пример #1
0
func NewSrsClient(conn *net.TCPConn) (r *SrsClient, err error) {
	r = &SrsClient{}
	r.conn = conn
	r.res = NewSrsResponse()
	r.id = SrsGenerateId()

	if r.rtmp, err = rtmp.NewServer(conn); err != nil {
		return
	}
	r.req = rtmp.NewRequest()
	return
}
Пример #2
0
func NewSrsClient(conn *net.TCPConn, server *SrsServer) (r *SrsClient, err error) {
	r = &SrsClient{
		conn:   conn,
		res:    NewSrsResponse(),
		id:     SrsGenerateId(),
		server: server,
	}
	if r.rtmp, err = rtmp.NewServer(conn); err != nil {
		return
	}
	r.req = rtmp.NewRequest()
	return
}