mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws: create HandshakeMachine from ConnectionStage
This commit is contained in:
parent
2967129c1f
commit
0bcfffb2bd
5 changed files with 122 additions and 105 deletions
|
|
@ -2,6 +2,7 @@ use std::fs::File;
|
|||
use std::io::Read;
|
||||
use std::time::Instant;
|
||||
|
||||
use either::Either;
|
||||
use mio::Token;
|
||||
use native_tls::{Identity, TlsAcceptor};
|
||||
use net2::{TcpBuilder, unix::UnixTcpBuilderExt};
|
||||
|
|
@ -58,7 +59,7 @@ pub fn create_tls_acceptor(
|
|||
|
||||
|
||||
pub fn close_connection(connection: &mut Connection){
|
||||
if let ConnectionStage::EstablishedWs(ref mut ews) = connection.stage {
|
||||
if let Either::Left(ref mut ews) = connection.inner {
|
||||
if ews.ws.can_read(){
|
||||
ews.ws.close(None).unwrap();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue