projects
/
crypto_lab1.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Begining of the machine oracle (work in progress..)
[crypto_lab1.git]
/
src
/
end_point.rs
diff --git
a/src/end_point.rs
b/src/end_point.rs
index
71f217e
..
2d0a66c
100644
(file)
--- a/
src/end_point.rs
+++ b/
src/end_point.rs
@@
-15,7
+15,7
@@
pub struct Client {
end_point: EndPoint,
}
end_point: EndPoint,
}
-struct EndPoint {
+
pub
struct EndPoint {
socket: TcpStream,
current_timestamp: u64
}
socket: TcpStream,
current_timestamp: u64
}
@@
-33,7
+33,7
@@
impl Server {
for stream in acceptor.incoming() {
match stream {
Ok(stream) => spawn(proc() {
for stream in acceptor.incoming() {
match stream {
Ok(stream) => spawn(proc() {
- Server::handle_client(EndPoint
{ socket: stream, current_timestamp: 0 }
);
+ Server::handle_client(EndPoint
::new(stream)
);
}),
_ => return
}
}),
_ => return
}
@@
-246,6
+246,10
@@
impl Client {
}
impl EndPoint {
}
impl EndPoint {
+ pub fn new(socket: TcpStream) -> EndPoint {
+ EndPoint { socket: socket, current_timestamp: 0 }
+ }
+
fn close(&mut self) -> IoResult<()> {
try!(self.socket.close_read());
try!(self.socket.close_write());
fn close(&mut self) -> IoResult<()> {
try!(self.socket.close_read());
try!(self.socket.close_write());