This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cell::Cell; | |
struct Source<'a> { | |
string: &'a str, | |
pos: Cell<usize>, | |
} | |
impl<'a> Source<'a> { | |
fn new(string: &str) -> Source{ | |
Source { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "rustcp_server" | |
version = "0.1.0" | |
[dependencies] | |
lazy_static = "0.2.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io; | |
use std::io::prelude::*; | |
use std::net::{IpAddr, TcpStream, SocketAddr}; | |
use std::env; | |
fn session(stream: &mut TcpStream){ | |
let _ = stream.write(b"ENTER\r\n"); | |
let mut banner = String::new(); | |
let _ = stream.read_to_string(&mut banner); | |
println!("{}", banner); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "rust_de_tcpclient" | |
version = "0.1.0" | |
[dependencies] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "rust_de_zundoko" | |
version = "0.1.0" | |
[dependencies] | |
rand="0.3.0" |
NewerOlder