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