// Sends the s0, s1, and s2 sequence and returns the s1 message that was generated
Sends the s0, s1, and s2 sequence and returns the s1 message that was generated
// Sends the s0 s1 and s2 sequence and returns the s1 message that was generated
func (h *Handshaker) sendS0S1S2(c1 []byte) ([]byte, error) {
	var s0s1s2 [1 + 2*1536]byte
	var err error
	s0s1s2[0] = RtmpVersion3
	if err = h.generateRandomData(s0s1s2[1:1537]); err != nil {
		return nil, err
	}
	if err = h.generateEcho(s0s1s2[1537:], c1); err != nil {
		return nil, err
	}
	err = h.send(s0s1s2[:])
	if err != nil {
		return nil, err
	}
	return s0s1s2[1:1537], nil
}
func ( h * Handshaker ) sendS0S1S2 ( c1 [ ] byte ) ( [ ] byte , error ) { var s0s1s2 [ 1 + 2 * 1536 ] byte var err error s0s1s2 [ 0 ] = RtmpVersion3 if err = h . generateRandomData ( s0s1s2 [ 1 : 1537 ] ) ; err != nil { return nil , err } if err = h . generateEcho ( s0s1s2 [ 1537 : ] , c1 ) ; err != nil { return nil , err } err = h . send ( s0s1s2 [ : ] ) if err != nil { return nil , err } return s0s1s2 [ 1 : 1537 ] , nil }
Sends the s0, s1, and s2 sequence and returns the s1 message that was generated
Sends the s0 s1 and s2 sequence and returns the s1 message that was generated
// s0 message is stored in byte 0 // s1 message is stored in bytes 1-1536 // s2 message is stored in bytes 1537-3073