X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e725ba4fc2984f86fc64c405ecb50883e2178e6e..920b92a3fd568f012a8f7814d56640cb729ba993:/interface/wx/socket.h diff --git a/interface/wx/socket.h b/interface/wx/socket.h index dddc204a8e..0a7d42ba8e 100644 --- a/interface/wx/socket.h +++ b/interface/wx/socket.h @@ -70,12 +70,12 @@ public: @return @true on success, @false if something goes wrong (invalid @a service). */ - bool Service(unsigned short service); + bool Service(unsigned short service) = 0; /** Returns the current service. */ - unsigned short Service(); + unsigned short Service() const = 0; }; @@ -197,7 +197,7 @@ public: @return @true on success, @false if something went wrong. */ - virtual bool AnyAddress(); + virtual bool AnyAddress() = 0; /** Internally, this is the same as setting the IP address to @b INADDR_BROADCAST. @@ -206,7 +206,7 @@ public: @return @true on success, @false if something went wrong. */ - virtual bool BroadcastAddress(); + virtual bool BroadcastAddress() = 0; /** Set the address to hostname, which can be a host name or an IP-style address @@ -215,24 +215,24 @@ public: @return @true on success, @false if something goes wrong (invalid hostname or invalid IP address). */ - virtual bool Hostname(const wxString& hostname); + virtual bool Hostname(const wxString& hostname) = 0; /** Returns the hostname which matches the IP address. */ - virtual wxString Hostname(); + virtual wxString Hostname() const = 0; /** Returns a wxString containing the IP address. */ - virtual wxString IPAddress(); + virtual wxString IPAddress() const = 0; /** Determines if current address is set to localhost. @return @true if address is localhost, @false if internet address. */ - virtual bool IsLocalHost(); + virtual bool IsLocalHost() const = 0; /** Set address to localhost. @@ -243,26 +243,26 @@ public: @return @true on success, @false if something went wrong. */ - virtual bool LocalHost(); + virtual bool LocalHost() = 0; /** Set the port to that corresponding to the specified service. @return @true on success, @false if something goes wrong (invalid @a service). */ - virtual bool Service(const wxString& service); + virtual bool Service(const wxString& service) = 0; /** Set the port to that corresponding to the specified service. @return @true on success, @false if something goes wrong (invalid @a service). */ - virtual bool Service(unsigned short service); + virtual bool Service(unsigned short service) = 0; /** Returns the current service. */ - virtual unsigned short Service(); + virtual unsigned short Service() const = 0; }; @@ -1196,6 +1196,8 @@ public: /** @class wxDatagramSocket + @todo docme + @library{wxnet} @category{net} */ @@ -1205,37 +1207,19 @@ public: /** Constructor. + @param addr + The socket address. @param flags - Socket flags (See wxSocketBase::SetFlags()) + Socket flags (See wxSocketBase::SetFlags()). */ - wxDatagramSocket(wxSocketFlags flags = wxSOCKET_NONE); + wxDatagramSocket(const wxSockAddress& addr, + wxSocketFlags flags = wxSOCKET_NONE); /** Destructor. Please see wxSocketBase::Destroy(). */ virtual ~wxDatagramSocket(); - /** - This function reads a buffer of @a nbytes bytes from the socket. - Use wxSocketBase::LastCount() to verify the number of bytes actually read. - Use wxSocketBase::Error() to determine if the operation succeeded. - - @param address - Any address - will be overwritten with the address of the peer that sent - that data. - @param buffer - Buffer where to put read data. - @param nbytes - Number of bytes. - - @return Returns a reference to the current object, and the address of - the peer that sent the data on address param. - - @see wxSocketBase::LastError(), wxSocketBase::SetFlags() - */ - wxDatagramSocket ReceiveFrom(wxSockAddress& address, - void* buffer, wxUint32 nbytes); - /** This function writes a buffer of @a nbytes bytes to the socket. Use wxSocketBase::LastCount() to verify the number of bytes actually wrote. @@ -1252,7 +1236,7 @@ public: @see wxSocketBase::LastError(), wxSocketBase::SetFlags() */ - wxDatagramSocket SendTo(const wxSockAddress& address, - const void* buffer, wxUint32 nbytes); + wxDatagramSocket& SendTo(const wxSockAddress& address, + const void* buffer, wxUint32 nbytes); };