)
const (
+ // RSize TODO
RSize = 8
+ // SSize TODO
SSize = 32
)
+// Handshake is state of a handshake/negotiation between client and server
type Handshake struct {
addr string
conn io.Writer
return &hashed
}
-// Create new handshake state.
+// NewHandshake create new handshake state.
func NewHandshake(addr string, conn io.Writer, conf *PeerConf) *Handshake {
state := Handshake{
addr: addr,
return sum[len(sum)-8:]
}
-// Start handshake's procedure from the client. It is the entry point
+// HandshakeStart start handshake's procedure from the client. It is the entry point
// for starting the handshake procedure.
// First handshake packet will be sent immediately.
func HandshakeStart(addr string, conn io.Writer, conf *PeerConf) *Handshake {
return state
}
-// Process handshake message on the server side.
+// Server process handshake message on the server side.
// This function is intended to be called on server's side.
// If this is the final handshake message, then new Peer object
// will be created and used as a transport. If no mutually
return nil
}
-// Process handshake message on the client side.
+// Client process handshake message on the client side.
// This function is intended to be called on client's side.
// If this is the final handshake message, then new Peer object
// will be created and used as a transport. If no mutually