use std::{net::SocketAddr, sync::Arc};

use super::KcpConnMgr;

pub trait KcpSession: Sync + Send {
    fn new(
        conn_mgr: Arc<KcpConnMgr<Self>>,
        session_id: u32,
        token: u32,
        recv_buf_len: usize,
        udp_remote_endpoint: SocketAddr,
    ) -> Self
    where
        Self: Sized;

    fn on_connect(&mut self, data: u32);
    fn on_disconnect(&self, reason: u32);
    fn input(self: Arc<Self>, buf: Box<[u8]>) -> impl std::future::Future<Output = ()> + Send;
    fn get_remote_ip(&self) -> u32;
    fn get_user_session_id(&self) -> u32;
    fn get_user_token(&self) -> u32;
    fn get_udp_remote_endpoint(&self) -> SocketAddr;
}
