diff --git a/rtmp/connect.go b/rtmp/connect.go index e5a0629..0e89b3c 100644 --- a/rtmp/connect.go +++ b/rtmp/connect.go @@ -1,5 +1,6 @@ package rtmp +import "fmt" func NegotiateConnect(chnk_wrp_ptr *ChunkWrapper) (bool) { if err := chnk_wrp_ptr.ReadPeerChunkSize(); err != nil { @@ -22,3 +23,15 @@ func NegotiateConnect(chnk_wrp_ptr *ChunkWrapper) (bool) { } return true } + +func CreateStream(chnk_wrp_ptr *ChunkWrapper) (bool) { + if _, err := chnk_wrp_ptr.ReadChunk(); err != nil { + return false + } + if _, err := chnk_wrp_ptr.ReadChunk(); err != nil { + return false + } + full_msg_ptr, _ := chnk_wrp_ptr.ReadChunk() + fmt.Println(full_msg_ptr) + return true +} diff --git a/rtmp/server.go b/rtmp/server.go index 702a7e2..dd0e02b 100644 --- a/rtmp/server.go +++ b/rtmp/server.go @@ -45,6 +45,8 @@ func handle_conn(conn net.Conn, stream_live *bool) { if !NegotiateConnect(chunk_wrapper) { return } - + if !CreateStream(chunk_wrapper) { + return + } *stream_live = false }