use crate::message::PendingSlot;
use kevy_resp::Argv;
use kevy_sys::Socket;
use std::collections::{HashSet, VecDeque};
pub(crate) struct Conn {
pub(crate) sock: Socket,
pub(crate) input: Vec<u8>,
pub(crate) output: Vec<u8>,
pub(crate) write_pos: usize,
pub(crate) want_write: bool,
pub(crate) next_seq: u64,
pub(crate) next_emit: u64,
pub(crate) closing: bool,
pub(crate) pending: VecDeque<PendingSlot>,
pub(crate) sub: HashSet<Vec<u8>>,
pub(crate) multi: Option<Vec<Argv>>,
}
impl Conn {
pub(crate) fn new(sock: Socket) -> Self {
Conn {
sock,
input: Vec::new(),
output: Vec::new(),
write_pos: 0,
want_write: false,
next_seq: 0,
next_emit: 0,
closing: false,
pending: VecDeque::new(),
sub: HashSet::new(),
multi: None,
}
}
}