载入中...
搜索中...
未找到
eve::network::UdpSocket类 参考

UDP socket backed by Poco::Net; supports connect/bind and datagram send. 更多...

#include <UdpSocket.h>

Public 成员函数

 UdpSocket (Network *net)
 Creates an unbound socket owned by the given module.
 
 ~UdpSocket ()
 
bool bind (uint16_t port)
 Binds to a local port; true on success.
 
bool connect (std::string host, uint16_t port)
 Connects to a remote host:port (restricts send()).
 
bool sendTo (eve::data::ByteData *data, std::string host, uint16_t port)
 Sends a datagram to an explicit host:port.
 
bool sendToString (std::string s, std::string host, uint16_t port)
 Sends a string datagram to an explicit host:port.
 
bool send (eve::data::ByteData *data)
 Sends a datagram to the connected peer.
 
bool sendString (std::string s)
 Sends a string datagram to the connected peer.
 
void close ()
 Closes the socket.
 
Poco::Net::DatagramSocket * datagram ()
 Internal: underlying Poco datagram socket.
 
bool isBound () const
 True after bind().
 
Networknetwork () const
 Owning module.
 

详细描述

UDP socket backed by Poco::Net; supports connect/bind and datagram send.

在文件 UdpSocket.h24 行定义.

构造及析构函数说明

◆ UdpSocket()

eve::network::UdpSocket::UdpSocket ( Network net)
explicit

Creates an unbound socket owned by the given module.

在文件 UdpSocket.cpp12 行定义.

◆ ~UdpSocket()

eve::network::UdpSocket::~UdpSocket ( )

在文件 UdpSocket.cpp14 行定义.

引用了 close().

成员函数说明

◆ bind()

bool eve::network::UdpSocket::bind ( uint16_t  port)

Binds to a local port; true on success.

在文件 UdpSocket.cpp22 行定义.

引用了 c, eve::network::Err, eve::network::Network::post(), eve::network::NetCompletion::type, eve::network::Udp , 以及 eve::network::Network::watchUdp().

被这些函数引用 eve::network::NetHost::start().

◆ close()

void eve::network::UdpSocket::close ( )

Closes the socket.

在文件 UdpSocket.cpp129 行定义.

引用了 eve::network::Network::unwatchUdp().

被这些函数引用 ~UdpSocket().

◆ connect()

bool eve::network::UdpSocket::connect ( std::string  host,
uint16_t  port 
)

Connects to a remote host:port (restricts send()).

在文件 UdpSocket.cpp47 行定义.

引用了 c, eve::network::Err, eve::network::Network::post(), eve::network::NetCompletion::type, eve::network::Udp , 以及 eve::network::Network::watchUdp().

◆ datagram()

Poco::Net::DatagramSocket * eve::network::UdpSocket::datagram ( )

Internal: underlying Poco datagram socket.

在文件 UdpSocket.cpp18 行定义.

◆ isBound()

bool eve::network::UdpSocket::isBound ( ) const
inline

True after bind().

在文件 UdpSocket.h48 行定义.

◆ network()

Network * eve::network::UdpSocket::network ( ) const
inline

Owning module.

在文件 UdpSocket.h50 行定义.

◆ send()

bool eve::network::UdpSocket::send ( eve::data::ByteData data)

Sends a datagram to the connected peer.

在文件 UdpSocket.cpp100 行定义.

引用了 c, data, eve::network::Err, n, eve::network::NetWorker::submit(), eve::network::NetCompletion::type, eve::network::Udp , 以及 eve::network::Network::worker().

被这些函数引用 sendString().

◆ sendString()

bool eve::network::UdpSocket::sendString ( std::string  s)

Sends a string datagram to the connected peer.

在文件 UdpSocket.cpp123 行定义.

引用了 data, s , 以及 send().

◆ sendTo()

bool eve::network::UdpSocket::sendTo ( eve::data::ByteData data,
std::string  host,
uint16_t  port 
)

Sends a datagram to an explicit host:port.

在文件 UdpSocket.cpp70 行定义.

引用了 c, data, eve::network::Err, n, eve::network::NetWorker::submit(), eve::network::NetCompletion::type, eve::network::Udp , 以及 eve::network::Network::worker().

被这些函数引用 sendToString().

◆ sendToString()

bool eve::network::UdpSocket::sendToString ( std::string  s,
std::string  host,
uint16_t  port 
)

Sends a string datagram to an explicit host:port.

在文件 UdpSocket.cpp94 行定义.

引用了 data, s , 以及 sendTo().


该类的文档由以下文件生成: