zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Split_UDP_Socket Class Reference

A higher level UDP_Socket. More...

#include <Net.h>

Inherits Zeni::UDP_Socket.

Public Member Functions

 Split_UDP_Socket (const Uint16 &port, const Uint16 &chunk_sets=ZENI_DEFAULT_CHUNK_SETS, const Uint16 &chunk_size=ZENI_DEFAULT_CHUNK_SIZE)
 
virtual int receive (IPaddress &ip, const void *const &data, const Uint16 &num_bytes)
 Receive data of up to data.size() from the returned IPaddress; Will error if num_bytes/data.size() is too low. More...
 
virtual int receive (IPaddress &ip, String &data)
 
virtual void send (const IPaddress &ip, const void *const &data, const Uint16 &num_bytes)
 Send data to an IPaddress. More...
 
virtual void send (const IPaddress &ip, const String &data)
 
- Public Member Functions inherited from Zeni::UDP_Socket
 UDP_Socket (const Uint16 &port)
 
virtual ~UDP_Socket ()
 
IPaddress peer_address () const
 Apparently only works if the port was explicitly specified. More...
 

Detailed Description

A higher level UDP_Socket.

It works almost identically to the UDP_Socket as far as users should be concerned. On the other hand, it works around UDP packet size limitations very well (and adds some overhead in the process). If you need to use this, your design is probably flawed, but it does its job as needed.

Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 280 of file Net.h.

Constructor & Destructor Documentation

Zeni::Split_UDP_Socket::Split_UDP_Socket ( const Uint16 port,
const Uint16 chunk_sets = ZENI_DEFAULT_CHUNK_SETS,
const Uint16 chunk_size = ZENI_DEFAULT_CHUNK_SIZE 
)

Definition at line 465 of file Net.cpp.

References assert.

Member Function Documentation

int Zeni::Split_UDP_Socket::receive ( IPaddress ip,
const void *const data,
const Uint16 num_bytes 
)
virtual

Receive data of up to data.size() from the returned IPaddress; Will error if num_bytes/data.size() is too low.

Reimplemented from Zeni::UDP_Socket.

Definition at line 518 of file Net.cpp.

References Zeni::String::c_str(), chunk, int, memcpy, Zeni::UDP_Socket::receive(), Zeni::String::resize(), Zeni::VLUID::size(), Zeni::String::size(), Zeni::String::std_str(), u, Zeni::VLUID::unserialize(), and Zeni::unserialize().

Referenced by receive().

int Zeni::Split_UDP_Socket::receive ( IPaddress ip,
String data 
)
virtual

Reimplemented from Zeni::UDP_Socket.

Definition at line 561 of file Net.cpp.

References Zeni::String::c_str(), receive(), Zeni::String::resize(), and Zeni::String::size().

void Zeni::Split_UDP_Socket::send ( const IPaddress ip,
const void *const data,
const Uint16 num_bytes 
)
virtual
void Zeni::Split_UDP_Socket::send ( const IPaddress ip,
const String data 
)
virtual

Reimplemented from Zeni::UDP_Socket.

Definition at line 514 of file Net.cpp.

References Zeni::String::c_str(), send(), and Zeni::String::size().


The documentation for this class was generated from the following files: