contents up previous next

wxdatagramsocket

derived from

wxsocketbase

include files

<wx/socket.h>

members

wxdatagramsocket::wxdatagramsocket
wxdatagramsocket::~wxdatagramsocket
wxdatagramsocket::receivefrom
wxdatagramsocket::sendto


wxdatagramsocket::wxdatagramsocket

wxdatagramsocket(wxsocketflags flags = wxsocket_none)

constructor.

parameters

flags


wxdatagramsocket::~wxdatagramsocket

~wxdatagramsocket()

destructor. please see wxsocketbase::destroy.


wxdatagramsocket::receivefrom

wxdatagramsocket& receivefrom(wxsockaddress& address, void * buffer, wxuint32 nbytes)

this function reads a buffer of nbytes bytes from the socket.

use lastcount to verify the number of bytes actually read.

use error to determine if the operation succeeded.

parameters

address

buffer

nbytes

return value

returns a reference to the current object, and the address of the peer that sent the data on address param.

see also

wxsocketbase::error, wxsocketbase::lasterror, wxsocketbase::lastcount, wxsocketbase::setflags,


wxdatagramsocket::sendto

wxdatagramsocket& sendto(const wxsockaddress& address, const void * buffer, wxuint32 nbytes)

this function writes a buffer of nbytes bytes to the socket.

use lastcount to verify the number of bytes actually wrote.

use error to determine if the operation succeeded.

parameters

address

buffer

nbytes

return value

returns a reference to the current object.

see also

wxsocketbase::error, wxsocketbase::lasterror, wxsocketbase::lastcount, wxsocketbase::setflags