Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
引数を直接SocketAddrにした
Browse files Browse the repository at this point in the history
shunsuke-shimomura committed May 27, 2024
1 parent d8fed83 commit d3e306c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kble-tcp/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::net::SocketAddr;

use anyhow::Result;
use clap::Parser;
use futures::{SinkExt, StreamExt};
@@ -8,8 +10,7 @@ use tracing_subscriber::{prelude::*, EnvFilter};
#[derive(Debug, Parser)]
#[clap(author, version, about, long_about = None)]
struct Args {
host: String,
port: String,
addr: SocketAddr
}

#[tokio::main]
@@ -23,9 +24,8 @@ async fn main() -> Result<()> {
.with(EnvFilter::from_default_env())
.init();
let args = Args::parse();
let addr = format!("{}:{}", args.host, args.port);

let tcp_stream = TcpStream::connect(addr).await?;
let tcp_stream = TcpStream::connect(args.addr).await?;
let (mut tcp_upstream, mut tcp_downstream) = tokio::io::split(tcp_stream);
let (mut tx, mut rx) = kble_socket::from_stdio().await;
let to_tcp = async {

0 comments on commit d3e306c

Please sign in to comment.