NetworkClient

Struct NetworkClient 

Source
pub struct NetworkClient { /* private fields */ }
Expand description

A client for network-based fuzzing that supports both TCP and UDP protocols.

Implementations§

Source§

impl NetworkClient

Source

pub fn new(protocol: Protocol, timeout_usecs: u64) -> Self

Create a new NetworkClient with the specified protocol and timeout.

§Arguments
  • protocol - The network protocol to use (TCP or UDP)
  • timeout_usecs - Connection and I/O timeout in microseconds
§Returns

A new NetworkClient instance

Source

pub fn connect_to_server(&mut self, host: &str, port: u16) -> Result<()>

Connect to a target server.

§Arguments
  • host - Hostname or IP address of the target server
  • port - Port number of the target server
§Returns

Ok(()) on successful connection, or an error if connection fails

§Description

For TCP, this performs the actual connection and will retry up to 1000 times. For UDP, this sets up the socket but doesn’t establish a connection.

Source

pub fn send_message(&mut self, message: &[u8]) -> Result<()>

Send a message to the connected server.

§Arguments
  • message - The byte array to send
§Returns

Ok(()) on successful send, or an error if sending fails

§Description

For TCP, this writes directly to the stream. For UDP, this sends a datagram to the previously specified server address.

Trait Implementations§

Source§

impl Debug for NetworkClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<Head, T> Append<T> for Head

Source§

fn append(self, value: T) -> (Head, T)

Append Value and return the tuple
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Tail, T> Prepend<T> for Tail

Source§

fn prepend(self, value: T) -> (T, Tail)

Prepend a value to this tuple, returning a new tuple with prepended value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> MaybeHasClientPerfMonitor for T