Store and init protocol parameters
This commit is contained in:
parent
05087ccbb3
commit
510be80449
1 changed files with 10 additions and 1 deletions
|
@ -4,6 +4,13 @@ import (
|
|||
"net"
|
||||
)
|
||||
|
||||
type ProtocolParams struct {
|
||||
peer_chunk_size uint32
|
||||
chunk_size uint32
|
||||
peer_ack_win uint32
|
||||
curr_read uint32
|
||||
}
|
||||
|
||||
func NewServer(port *string) (error) {
|
||||
l, err := net.Listen("tcp", ":" + *port)
|
||||
if err != nil {
|
||||
|
@ -33,7 +40,9 @@ func handle_conn(conn net.Conn, stream_live *bool) {
|
|||
if !DoHandshake(conn) {
|
||||
return
|
||||
}
|
||||
if !NegotiateConnect(conn) {
|
||||
params := ProtocolParams{1024, 512, 0, 0}
|
||||
open_chnkstrms, open_msgs, chunk_buffers := OpenStreamsMapInit()
|
||||
if !NegotiateConnect(conn, ¶ms, open_chnkstrms, open_msgs, chunk_buffers) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue