Microsoft.Xna.Framework.Net
Enum SendDataOptions
java.lang.Object
java.lang.Enum<SendDataOptions>
Microsoft.Xna.Framework.Net.SendDataOptions
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<SendDataOptions>
public enum SendDataOptions
- extends java.lang.Enum<SendDataOptions>
Defines options for network packet transmission.
- Author:
- Halofreak1990
Enum Constant Summary |
Chat
Mark that this packet contains chat data, such as a player-to-player message string entered using the keyboard. |
InOrder
Sends the data with guaranteed ordering, but without reliable delivery. |
None
Sends the data with no guarantees. |
Reliable
Sends the data with reliable delivery, but no special ordering. |
ReliableInOrder
Sends the data with reliability and arrival in the order originally sent. |
Method Summary |
static SendDataOptions |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static SendDataOptions[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
Methods inherited from class java.lang.Enum |
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
None
public static final SendDataOptions None
- Sends the data with no guarantees. Packets of this type may be delivered in any order, with occasional packet loss. This is the most efficient option in terms of network bandwidth and machine resource usage. However, it is recommended only in situations where your game can recover from occasional packet loss.
Reliable
public static final SendDataOptions Reliable
- Sends the data with reliable delivery, but no special ordering. Packets of this type are resent until arrival at the destination. They may arrive out of order.
InOrder
public static final SendDataOptions InOrder
- Sends the data with guaranteed ordering, but without reliable delivery. Occasionally, packets of this type are not delivered. However, any delivered packets always arrive in the order in which they are sent. Use this option in situations where the transmitted value changes constantly. Old versions never arrive after a more recent version.
ReliableInOrder
public static final SendDataOptions ReliableInOrder
- Sends the data with reliability and arrival in the order originally sent. Packets of this type are resent until arrival and ordered internally. This means they arrive in the same order in which they were sent. In terms of network bandwidth usage, this is the strongest and most expensive option. Use this only when arrival and ordering are essential. Commonly, a game uses this option for a small percentage of packets. The majority of gameplay data is sent using None or Reliable.
Chat
public static final SendDataOptions Chat
- Mark that this packet contains chat data, such as a player-to-player message string entered using the keyboard. To comply with international regulations, you must send such data without packet encryption. Therefore, you must use this flag to mark it. To maintain security, other game data should not use this flag. It is acceptable and efficient to mix encrypted and unencrypted data. If you send packets both with and without this flag within a single frame, both the encrypyted and unencrypted data streams will be merged into a single wire packet. This option can be combined with either or both of the Reliable and InOrder flags. When you request in-order delivery for chat packets, they will be ordered relative to other chat packets, but they may arrive out of order with respect to other non-chat data.
values
public static SendDataOptions[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (SendDataOptions c : SendDataOptions.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static SendDataOptions valueOf(java.lang.String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name
- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is null