Commit 0f8e3af1 authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

change port; change log

parent ea2a7e34
......@@ -3,6 +3,6 @@ use tenjin::{openflow::ofp10::ControllerFrame10, Controller};
extern crate byteorder;
fn main() -> Result<(), std::io::Error> {
Controller::listener("127.0.0.1:6633");
Controller::listener("127.0.0.1:6653");
Ok(())
}
......@@ -17,6 +17,7 @@ pub trait ControllerFrame10 {
fn new() -> Self;
fn listener(address: &str) {
println!("server run at {}", address);
let _ = tcp_listener_handler(address);
}
......
......@@ -10,7 +10,7 @@ pub fn tcp_listener_handler(address: &str) -> Result<(), std::io::Error> {
for stream in listener.incoming() {
match stream {
Ok(mut stream) => {
if let Ok(addr) = stream.local_addr() {
if let Ok(addr) = stream.peer_addr() {
println!("server has connection from {}", addr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment