basic data loop handle (placeholder)
This commit is contained in:
parent
70d7ba474e
commit
050e8b104f
3 changed files with 18 additions and 3 deletions
|
@ -1,7 +1,6 @@
|
|||
package rtmp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
@ -53,8 +52,6 @@ func PublishAsKey(chnk_wrp_ptr *ChunkWrapper) (bool) {
|
|||
if err := chnk_wrp_ptr.WritePublishResponse(); err != nil {
|
||||
return false
|
||||
}
|
||||
p, _ := chnk_wrp_ptr.ReadChunk()
|
||||
fmt.Println(p)
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
17
rtmp/data_loop.go
Normal file
17
rtmp/data_loop.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package rtmp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func HandleDataLoop(chnk_wrp_ptr *ChunkWrapper) {
|
||||
for {
|
||||
p, err := chnk_wrp_ptr.ReadChunk()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if p != nil {
|
||||
fmt.Println(p.msg_type, p.msg_len)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -52,5 +52,6 @@ func handle_conn(conn net.Conn, stream_live *bool) {
|
|||
if !PublishAsKey(chunk_wrapper) {
|
||||
return
|
||||
}
|
||||
HandleDataLoop(chunk_wrapper)
|
||||
*stream_live = false
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue