Loop chunk read
This commit is contained in:
parent
510be80449
commit
d5d2301cad
1 changed files with 10 additions and 12 deletions
|
@ -5,17 +5,15 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NegotiateConnect(conn net.Conn) (bool) {
|
func NegotiateConnect(conn net.Conn, params *ProtocolParams, open_chnkstrms map[uint32]*ChunkStream, open_msgs map[uint32]*Message, chunk_bufs *ChunkBuffers) (bool) {
|
||||||
open_chnkstrms, open_msgs, chunk_bufs := OpenStreamsMapInit()
|
for {
|
||||||
full_msg_ptr, err := ReadChunk(conn, open_chnkstrms, open_msgs, 4096, chunk_bufs)
|
full_msg_ptr, err := ReadChunk(conn, open_chnkstrms, open_msgs, params.peer_chunk_size, chunk_bufs, &(params.curr_read))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
fmt.Printf("%08b\n", full_msg_ptr.data)
|
if full_msg_ptr == nil {
|
||||||
full_msg_ptr, err = ReadChunk(conn, open_chnkstrms, open_msgs, 4096, chunk_bufs)
|
continue
|
||||||
if err != nil {
|
}
|
||||||
return false
|
fmt.Println(*full_msg_ptr)
|
||||||
}
|
}
|
||||||
fmt.Printf("%08b\n", full_msg_ptr.data)
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue