+/**
+ @anchor wxSocketFlags
+
+ wxSocket Flags.
+
+ A brief overview on how to use these flags follows.
+
+ If no flag is specified (this is the same as @b wxSOCKET_NONE),
+ IO calls will return after some data has been read or written, even
+ when the transfer might not be complete. This is the same as issuing
+ exactly one blocking low-level call to @b recv() or @b send(). Note
+ that @e blocking here refers to when the function returns, not
+ to whether the GUI blocks during this time.
+
+ If @b wxSOCKET_NOWAIT is specified, IO calls will return immediately.
+ Read operations will retrieve only available data. Write operations will
+ write as much data as possible, depending on how much space is available
+ in the output buffer. This is the same as issuing exactly one nonblocking
+ low-level call to @b recv() or @b send(). Note that @e nonblocking here
+ refers to when the function returns, not to whether the GUI blocks during
+ this time.
+
+ If @b wxSOCKET_WAITALL is specified, IO calls won't return until ALL
+ the data has been read or written (or until an error occurs), blocking if
+ necessary, and issuing several low level calls if necessary. This is the
+ same as having a loop which makes as many blocking low-level calls to
+ @b recv() or @b send() as needed so as to transfer all the data. Note
+ that @e blocking here refers to when the function returns, not
+ to whether the GUI blocks during this time.
+
+ The @b wxSOCKET_BLOCK flag controls whether the GUI blocks during
+ IO operations. If this flag is specified, the socket will not yield
+ during IO calls, so the GUI will remain blocked until the operation
+ completes. If it is not used, then the application must take extra
+ care to avoid unwanted reentrance.
+
+ The @b wxSOCKET_REUSEADDR flag controls the use of the @b SO_REUSEADDR standard
+ @b setsockopt() flag. This flag allows the socket to bind to a port that is
+ already in use. This is mostly used on UNIX-based systems to allow rapid starting
+ and stopping of a server, otherwise you may have to wait several minutes for the
+ port to become available.
+
+ @b wxSOCKET_REUSEADDR can also be used with socket clients to (re)bind to a
+ particular local port for an outgoing connection.
+ This option can have surprising platform dependent behavior, so check the
+ documentation for your platform's implementation of setsockopt().
+
+ Note that on BSD-based systems(e.g. Mac OS X), use of
+ @b wxSOCKET_REUSEADDR implies @b SO_REUSEPORT in addition to
+ @b SO_REUSEADDR to be consistent with Windows.
+
+ The @b wxSOCKET_BROADCAST flag controls the use of the @b SO_BROADCAST standard
+ @b setsockopt() flag. This flag allows the socket to use the broadcast address,
+ and is generally used in conjunction with @b wxSOCKET_NOBIND and
+ wxIPaddress::BroadcastAddress().
+
+ So:
+ - @b wxSOCKET_NONE will try to read at least SOME data, no matter how much.
+ - @b wxSOCKET_NOWAIT will always return immediately, even if it cannot
+ read or write ANY data.
+ - @b wxSOCKET_WAITALL will only return when it has read or written ALL
+ the data.
+ - @b wxSOCKET_BLOCK has nothing to do with the previous flags and
+ it controls whether the GUI blocks.
+ - @b wxSOCKET_REUSEADDR controls special platform-specific behavior for
+ reusing local addresses/ports.
+*/
+enum
+{
+ wxSOCKET_NONE = 0, ///< Normal functionality.
+ wxSOCKET_NOWAIT = 1, ///< Read/write as much data as possible and return immediately.
+ wxSOCKET_WAITALL = 2, ///< Wait for all required data to be read/written unless an error occurs.
+ wxSOCKET_BLOCK = 4, ///< Block the GUI (do not yield) while reading/writing data.
+ wxSOCKET_REUSEADDR = 8, ///< Allows the use of an in-use port (wxServerSocket only)
+ wxSOCKET_BROADCAST = 16, ///< Switches the socket to broadcast mode
+ wxSOCKET_NOBIND = 32 ///< Stops the socket from being bound to a specific
+ ///< adapter (normally used in conjunction with
+ ///< @b wxSOCKET_BROADCAST)
+};