|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<QUdpSocket.BindFlag>
com.trolltech.qt.network.QUdpSocket.BindFlag
public static enum QUdpSocket.BindFlag
This enum describes the different flags you can pass to modify the behavior of QUdpSocket.:bind().
Enum Constant Summary | |
---|---|
DefaultForPlatform
The default option for the current platform. |
|
DontShareAddress
Bind the address and port exclusively, so that no other services are allowed to rebind. |
|
ReuseAddressHint
Provides a hint to QUdpSocket that it should try to rebind the service even if the address and port are already bound by another socket. |
|
ShareAddress
Allow other services to bind to the same address and port. |
Method Summary | |
---|---|
static QUdpSocket.BindMode |
createQFlags(QUdpSocket.BindFlag... values)
|
static QUdpSocket.BindFlag |
resolve(int value)
|
int |
value()
This function should return an integer value for the enum values of the enumeration that implements this interface. |
static QUdpSocket.BindFlag |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static QUdpSocket.BindFlag[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final QUdpSocket.BindFlag DefaultForPlatform
The default option for the current platform. On Unix and Mac OS X, this is equivalent to (DontShareAddress + ReuseAddressHint), and on Windows, its equivalent to ShareAddress.
public static final QUdpSocket.BindFlag ShareAddress
Allow other services to bind to the same address and port. This is useful when multiple processes share the load of a single service by listening to the same address and port (e.g., a web server with several pre-forked listeners can greatly improve response time). However, because any service is allowed to rebind, this option is subject to certain security considerations. Note that by combining this option with ReuseAddressHint, you will also allow your service to rebind an existing shared address. On Unix, this is equivalent to the SO_REUSEADDR socket option. On Windows, this option is ignored.
public static final QUdpSocket.BindFlag DontShareAddress
Bind the address and port exclusively, so that no other services are allowed to rebind. By passing this option to QUdpSocket::bind(), you are guaranteed that on successs, your service is the only one that listens to the address and port. No services are allowed to rebind, even if they pass ReuseAddressHint. This option provides more security than ShareAddress, but on certain operating systems, it requires you to run the server with administrator privileges. On Unix and Mac OS X, not sharing is the default behavior for binding an address and port, so this option is ignored. On Windows, this option uses the SO_EXCLUSIVEADDRUSE socket option.
public static final QUdpSocket.BindFlag ReuseAddressHint
Provides a hint to QUdpSocket that it should try to rebind the service even if the address and port are already bound by another socket. On Windows, this is equivalent to the SO_REUSEADDR socket option. On Unix, this option is ignored.
Method Detail |
---|
public static final QUdpSocket.BindFlag[] values()
for(QUdpSocket.BindFlag c : QUdpSocket.BindFlag.values()) System.out.println(c);
public static QUdpSocket.BindFlag valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified namepublic int value()
QtEnumerator
value
in interface QtEnumerator
public static QUdpSocket.BindMode createQFlags(QUdpSocket.BindFlag... values)
public static QUdpSocket.BindFlag resolve(int value)
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |