pub mod schema;
use crate::schema::hello_world::HelloWorld;
+use connect::{Connection, SinkExt, StreamExt};
use log::*;
use protobuf::well_known_types::Any;
use std::env;
-use stitch_net::{SinkExt, StitchConnection, StreamExt};
#[async_std::main]
async fn main() -> anyhow::Result<()> {
};
// create a client connection to the server
- let mut conn = StitchConnection::tcp_client(ip_address)?;
+ let mut conn = Connection::tcp_client(ip_address).await?;
// send a message to the server
let raw_msg = String::from("Hello world");
- info!("Sending message: {}", raw_msg);
let mut msg = HelloWorld::new();
- msg.set_message(raw_msg);
+ msg.set_message(raw_msg.clone());
conn.writer().send(msg).await?;
+ info!("Sent message: {}", raw_msg);
// wait for the server to reply with an ack
while let Some(reply) = conn.reader().next().await {