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
// Bitcoin Dev Kit | |
// Written in 2021 by Alekos Filini <[email protected]> | |
// | |
// Copyright (c) 2020-2021 Bitcoin Dev Kit Developers | |
// | |
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE | |
// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. | |
// You may not use this file except in accordance with one or both of these | |
// licenses. |
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
// Updated example from http://rosettacode.org/wiki/Hello_world/Web_server#Rust | |
// to work with Rust 1.0 beta | |
use std::net::{TcpStream, TcpListener}; | |
use std::io::{Read, Write}; | |
use std::thread; | |
fn handle_read(mut stream: &TcpStream) { | |
let mut buf = [0u8 ;4096]; |