Add server docs

This commit is contained in:
Lucio Franco
2019-09-04 16:38:46 -04:00
parent 2a01ab229a
commit 77a6c89ae9
8 changed files with 107 additions and 13 deletions
+3 -4
View File
@@ -1,12 +1,12 @@
mod data;
use futures::{Stream, StreamExt};
use hyper::Server;
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
use std::sync::Arc;
use std::time::Instant;
use tokio::sync::{mpsc, Lock};
use tonic::transport::Server;
use tonic::{Request, Response, Status};
pub mod routeguide {
@@ -159,9 +159,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
},
};
Server::bind(&addr)
.http2_only(true)
.serve(RouteGuideServer::new(route_guide))
Server::builder()
.serve(addr, RouteGuideServer::new(route_guide))
.await?;
Ok(())