Beispiel #1
0
func (t *TestServer) handleConnection(rawConn net.Conn) {
	conn := transport.NewServer(rawConn, &t.identity)

	if err := conn.Handshake(); err != nil {
		panic(err)
	}

	t.server.Process(conn)
	conn.Close()
}
Beispiel #2
0
func handleConnection(server *Server, rawConn net.Conn, identity *[32]byte) {
	rawConn.SetDeadline(time.Now().Add(30 * time.Second))
	conn := transport.NewServer(rawConn, identity)

	if err := conn.Handshake(); err != nil {
		log.Printf("Error from handshake: %s", err)
		return
	}

	server.Process(conn)
	conn.Close()
}