// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
+
+/**
+ @class wxIPaddress
+
+ wxIPaddress is an abstract base class for all internet protocol address
+ objects. Currently, only wxIPV4address is implemented. An experimental
+ implementation for IPV6, wxIPV6address, is being developed.
+
+ @library{wxbase}
+ @category{net}
+*/
+class wxIPaddress : public wxSockAddress
+{
+public:
+ /**
+ Internally, this is the same as setting the IP address to @b INADDR_ANY.
+
+ On IPV4 implementations, 0.0.0.0
+
+ On IPV6 implementations, ::
+
+ @return @true on success, @false if something went wrong.
+ */
+ bool AnyAddress();
+
+ /**
+ Internally, this is the same as setting the IP address to @b INADDR_BROADCAST.
+
+ On IPV4 implementations, 255.255.255.255
+
+ @return @true on success, @false if something went wrong.
+ */
+ virtual bool BroadcastAddress() = 0;
+
+ /**
+ Set the address to hostname, which can be a host name or an IP-style address
+ in a format dependent on implementation.
+
+ @return @true on success, @false if something goes wrong (invalid
+ hostname or invalid IP address).
+ */
+ bool Hostname(const wxString& hostname);
+
+ /**
+ Returns the hostname which matches the IP address.
+ */
+ wxString Hostname() const;
+
+ /**
+ Returns a wxString containing the IP address.
+ */
+ 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() const = 0;
+
+ /**
+ Set address to localhost.
+
+ On IPV4 implementations, 127.0.0.1
+
+ On IPV6 implementations, ::1
+
+ @return @true on success, @false if something went wrong.
+ */
+ bool LocalHost();
+
+ /**
+ Set the port to that corresponding to the specified service.
+
+ @return @true on success, @false if something goes wrong (invalid @a service).
+ */
+ bool Service(const wxString& service);
+
+ /**
+ Set the port to that corresponding to the specified service.
+
+ @return @true on success, @false if something goes wrong (invalid @a service).
+ */
+ bool Service(unsigned short service);
+
+ /**
+ Returns the current service.
+ */
+ unsigned short Service() const;
+};
+
+
/**
@class wxIPV4address
@return @true on success, @false if something goes wrong (invalid @a service).
*/
- bool Service(unsigned short service) = 0;
+ bool Service(unsigned short service);
/**
Returns the current service.
*/
- unsigned short Service() const = 0;
+ unsigned short Service() const;
};
accepted, it will wait for the next incoming connection to
arrive.
- @warning: This method will block the GUI.
+ @warning This method will block the GUI.
If @a wait is @false, it will try to accept a pending connection
if there is one, but it will always return immediately without blocking
};
-
-/**
- @class wxIPaddress
-
- wxIPaddress is an abstract base class for all internet protocol address
- objects. Currently, only wxIPV4address is implemented. An experimental
- implementation for IPV6, wxIPV6address, is being developed.
-
- @library{wxbase}
- @category{net}
-*/
-class wxIPaddress : public wxSockAddress
-{
-public:
- /**
- Internally, this is the same as setting the IP address to @b INADDR_ANY.
-
- On IPV4 implementations, 0.0.0.0
-
- On IPV6 implementations, ::
-
- @return @true on success, @false if something went wrong.
- */
- virtual bool AnyAddress() = 0;
-
- /**
- Internally, this is the same as setting the IP address to @b INADDR_BROADCAST.
-
- On IPV4 implementations, 255.255.255.255
-
- @return @true on success, @false if something went wrong.
- */
- virtual bool BroadcastAddress() = 0;
-
- /**
- Set the address to hostname, which can be a host name or an IP-style address
- in a format dependent on implementation.
-
- @return @true on success, @false if something goes wrong (invalid
- hostname or invalid IP address).
- */
- virtual bool Hostname(const wxString& hostname) = 0;
-
- /**
- Returns the hostname which matches the IP address.
- */
- virtual wxString Hostname() const = 0;
-
- /**
- Returns a wxString containing the IP address.
- */
- 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() const = 0;
-
- /**
- Set address to localhost.
-
- On IPV4 implementations, 127.0.0.1
-
- On IPV6 implementations, ::1
-
- @return @true on success, @false if something went wrong.
- */
- 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) = 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) = 0;
-
- /**
- Returns the current service.
- */
- virtual unsigned short Service() const = 0;
-};
-
-
-
/**
@class wxSocketClient
If @a wait is @true, Connect() will wait until the connection
completes.
- @warning: This method will block the GUI.
+ @warning This method will block the GUI.
If @a wait is @false, Connect() will try to establish the connection
and return immediately, without blocking the GUI. When used this way,
Do not destroy a socket using the delete operator directly;
use Destroy() instead. Also, do not create socket objects in the stack.
*/
- ~wxSocketBase();
+ virtual ~wxSocketBase();
/**
Destroys the socket safely.
@return @true if no error happened, @false otherwise.
*/
- bool GetLocal(wxSockAddress& addr) const;
+ virtual bool GetLocal(wxSockAddress& addr) const;
/**
Return the peer address field of the socket.
@return @true if no error happened, @false otherwise.
*/
- bool GetPeer(wxSockAddress& addr) const;
+ virtual bool GetPeer(wxSockAddress& addr) const;
/**
Return the socket timeout in seconds.
complete immediately without blocking (unless the @b wxSOCKET_WAITALL flag
is set, in which case the operation might still block).
*/
- bool IsData() const;
+ bool IsData();
/**
Returns @true if the socket is not connected.
The application must therefore be prepared to handle socket event messages even
after calling Close().
*/
- void Close();
+ virtual bool Close();
/**
Shuts down the writing end of the socket.
be called for client sockets, if it is, @b bind() is called before @b
connect().
*/
- bool SetLocal(const wxIPV4address& local);
+ virtual bool SetLocal(const wxIPV4address& local);
/**
Set the default socket timeout in seconds.
functions if you don't specify a wait interval. Initially, the default
timeout is 10 minutes.
*/
- void SetTimeout(int seconds);
+ void SetTimeout(long seconds);
/**
Put the specified data into the input queue.