From 4eb739dcab2a1a79e1e0e60feddb0d9cc0d74108 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 19 Feb 2018 20:06:10 -0800 Subject: more WIP on synchronizer --- src/protocol.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/protocol.rs') diff --git a/src/protocol.rs b/src/protocol.rs index 6e70dbb..35681e1 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -1,5 +1,5 @@ -use std::net::{TcpStream, ToSocketAddrs}; +use std::net::{TcpStream, ToSocketAddrs, Shutdown}; use std::time::Duration; use std::io::{Read, Write}; use std::cmp; @@ -395,4 +395,8 @@ impl DatConnection { trace!("\twas: {:?}", reg); Ok(reg) } + + pub fn close(&mut self) { + self.tcp.shutdown(Shutdown::Both); + } } -- cgit v1.2.3