added redirection of data to their corresponding endpoints
This commit is contained in:
parent
8aa1fa98d9
commit
e0d9fa444b
5 changed files with 52 additions and 20 deletions
|
|
@ -1,19 +1,27 @@
|
|||
use std::net::UdpSocket;
|
||||
use std::sync::Arc;
|
||||
use crate::prudp::packet::VirtualPort;
|
||||
use log::info;
|
||||
use crate::prudp::packet::{PRUDPPacket, VirtualPort};
|
||||
use crate::prudp::server::Connection;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Endpoint{
|
||||
socket: Arc<UdpSocket>,
|
||||
virtual_port: VirtualPort,
|
||||
}
|
||||
|
||||
impl Endpoint{
|
||||
pub fn new(port: VirtualPort) -> Self{
|
||||
Self{
|
||||
virtual_port: port
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_virual_port(&self) -> VirtualPort{
|
||||
self.virtual_port
|
||||
}
|
||||
|
||||
fn process_packet(connection: &Connection){
|
||||
|
||||
pub fn process_packet(&self, connection: &Connection, packet: &PRUDPPacket){
|
||||
info!("recieved packet on endpoint")
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue