Releases: needle-mirror/com.unity.transport
Releases · needle-mirror/com.unity.transport
2.4.0
[2.4.0] - 2024-10-24
New features
- Connections can now be made using strings representing domain names or IPs. Hostname resolution will be performed automatically as part of the connection process. (Requires Unity 6000.18f1 or later.)
Changes
- ACKs for the
ReliableSequencedPipelineStage
will now be sent a little more aggressively, which should improve throughput of reliable traffic.
Fixes
- Fixed MultiNetworkDriver not passing the connect payload to the NetworkDriver when calling MultiNetworkDriver.Connect()
- Added a workaround for a burst compile error that caused iOS player builds not to function properly when burst compile was enabled.
1.5.0
[1.5.0] - 2024-08-20
Fixes
- Fixed a rare issue where a sequence ID collision from ushort overflow in certain very specific conditions can result in an old packet being erroneously returned instead of waiting for a new one, causing corruption.
2.3.0
[2.3.0] - 2024-06-21
New features
- The global network simulator (configurable through
NetworkSettings.WithNetworkSimulatorParameters
) now supports delay, jitter and packet duplication, but only in the send direction. Currently users are still recommended to use theSimulatorPipelineStage
for their network simulation needs until the global network simulator gains in maturity.
Changes
- Updated Burst dependency to 1.8.12.
Fixes
- Fixed an issue where
NetworkEndpoint.IsAny
andNetworkEndpoint.IsLoopback
would throw an exception for endpoints where the network family isNetworkFamily.Custom
. These properties will now return false for custom endpoints. - Fixed an issue where an error about resetting the event queue with pending events could be logged even if the connection with pending events was closed.
- Made the failure mode more obvious when there is a mismatch between the Relay configuration and the choice of network interface.
- Fixed a rare issue where a sequence ID collision from ushort overflow in certain very specific conditions can result in an old packet being erroneously returned instead of waiting for a new one, causing corruption.
2.2.1
[2.2.1] - 2023-12-06
Fixes
- Fixed an issue where
NetworkEndpoint.TryParse
would leave the out parameter endpoint with a validNetworkFamily
, even if parsing of the address had failed.
[2.2.0] - 2023-12-01
New features
- The WebSocket URL path can now be configured using
NetworkSettings.WithWebSocketParameters
. For clients, the path provided there is the path on which connections will be made. For servers, it's the path connections will be accepted on. - It is now possible to specify a payload to be sent along with connection requests through a new parameter for the
NetworkDriver.Connect
call. This payload is retrievable as-is on the server side when callingNetworkDriver.Accept
. An example usage would be to send an authentication token (thus alleviating the need to do this through a separate message).
Changes
- All parameter structures that can be used with
NetworkSettings
are now marked asSerializable
. - For custom endpoints,
NetworkDriver.Connect
will now automatically bind to the endpoint passed as a parameter instead of binding to the wildcard IPv4 address (only if the driver was not previously bound). - The size of
NetworkEndpoint
has been increased, which allows creating custom endpoints (endpoints where the family isNetworkFamily.Custom
) containing up to 60 bytes of data.
Fixes
- Allow creating a driver with the same Relay allocation as a previous driver. Note that having two drivers using the same Relay allocation at the same time is not supported. This fix is for the case where one disposes of a driver, and then creates a new one with the same Relay allocation.
- Fixed an issue where some data messages could be inadvertently dropped if the last message in the connection handshake was lost in transit.
- Fixed an issue where reliable packets could be resent even after they had been acknowledged, which would lead to wasted bandwidth.
- Fixed an issue that made it impossible to set the family of a
NetworkEndpoint
toNetworkFamily.Custom
. - Fixed an issue where it was possible for the state of a connection (as reported by
GetConnectionState
) would beDisconnected
one update before theDisconnect
event would appear throughPopEvent
. - Fixed an issue where WebSocket connections would be closed if the TCP OS buffers were overflowed. In this situation, traffic that can't be sent on the TCP socket will now accumulate in the send queue. If that fills up, then new
BeginSend
operations will returnError.StatusCode.NetworkSendQueueFull
and the situation can be handled by user as they see fit (e.g. buffer the traffic on the side). Frameworks like Netcode for GameObjects already handle this situation gracefully. - Fixed an issue where if the receive queue was filled up (say when pulling a lot of data at once from a socket), then WebSocket packets would fail to be processed and their associated connections would be closed.
1.4.1
[1.4.1] - 2023-11-27
Fixes
- Fixed an issue where reliable packets could be resent even after they had been acknowledged, which would lead to wasted bandwidth.
2.1.0
[2.1.0] - 2023-09-19
New features
- It is now possible to configure the maximum message size that the transport will send through a new
maxMessageSize
parameter inNetworkSettings.WithNetworkConfigParameters
. This is useful for environments where network equipment mishandles larger packets (like some mobile networks or VPNs). The value excludes IP and UDP headers, but includes headers added by the transport itself (e.g. reliability headers). The default value is 1400. Note that it is recommended that both client and server be configured to use the same value. - Added new values
AuthenticationFailure
andProtocolError
to theError.DisconnectReason
enum. These values are respectively returned when a connection fails to be established because of DTLS/TLS handshake failure, and for unexpected and unrecoverable errors encountered by the transport (e.g. unexpected socket errors or malformed WebSocket frames). - Added a new
NetworkFamily.Custom
value and proper support for it inNetworkEndpoint
. This value is intended for usage with customINetworkInterface
implementations, where endpoints are not IP addresses.
Changes
- Updated Collections dependency to 2.2.1.
- Updated Burst dependency to 1.8.8.
- Updated Mathematics dependency to 1.3.1.
NetworkDriver.GetRelayConnectionStatus
will now return the new enum valueRelayConnectionStatus.NotUsingRelay
when called on aNetworkDriver
that has not been configured to use Unity Relay. The previous behavior was to throw an exception. This can be used to safely determine if a driver is using Relay, even from Burst-compiled code.RelayServerData
now exposes aIsWebSocket
field that can be used to determine if the server data will be using a WebSocket endpoint. This value is set automatically if constructing theRelayServerData
from an allocation object, and can be set through a new optionalisWebSocket
parameter for low-level constructors.NetworkEndpoint.RawPort
is now obsolete. There is little use for this API since it basically only converts to/from network byte order. There are standard C# APIs to do this.
Fixes
- Fixed a possible crash when using secure WebSockets that would occur if a connection was closed suddenly with pending packets waiting to be sent.
- Fixed an issue where empty messages would not properly be received if sent on a non-default pipeline.
- Fixed "Input string was not in a correct format" log when listening on a port already in use.
1.4.0
[1.4.0] - 2023-06-28
New features
- Added a new
GetUnsafeReadOnlyPtr
method toDataStreamReader
. This is meant as an escape hatch for use cases that require passing stream readers outside of a job (this not possible withDataStreamReader
directly since the safety system will not allow it). As the name implies, this throws away many safety guarantees and is thus not recommended to use unless absolutely required.
Changes
NetworkDriver.GetRelayConnectionStatus
will now return the new enum valueRelayConnectionStatus.NotUsingRelay
when called on aNetworkDriver
that has not been configured to use Unity Relay. The previous behavior was to throw an exception.- It is now possible to configure the maximum message size that the transport will send through a new
maxMessageSize
parameter inNetworkSettings.WithNetworkConfigParameters
. This is useful for environments where network equipment mishandles larger packets (like some mobile networks or VPNs). The value excludes IP and UDP headers, but includes headers added by the transport itself (e.g. reliability headers). The default value is 1400. Note that it is recommended that both client and server be configured to use the same value.
2.0.2
[2.0.2] - 2023-05-30
Changes
- When using Unity Relay,
NetworkDriver.GetRemoteEndpoint
will now always return the address of the Relay server, instead of returning the address until a connection is established, and then returning the allocation ID encoded as an endpoint (appearing as an invalid endpoint). This makes the behavior the same as it was in version 1.X of the package. - Updated Collections dependency to 2.1.2.
- A warning will now be emitted if passing a connection type other than "wss" to the
RelayServerData
constructors on WebGL (other connection types are not supported on that platform).
Fixes
- Fixed an issue where the reliable pipeline stage could end up writing past the end of its internal buffer and thrashing the buffers of other connections. This could result in packet corruption, but would most likely result in erroneous -7 (
NetworkDriverParallelForErr
) errors being reported when callingEndSend
. - Fixed an issue where upon returning -7 (
NetworkDriverParallelForErr
),EndSend
would leak the send handle. Over time, this would result in less send handles being available, resulting in more -5 (NetworkSendQueueFull
) errors. - Fixed an issue where WebSocket connections would always take at least
connectTimeoutMS
milliseconds to be reported as established, even if the connection was actually established faster than that. - Fixed an issue where
ArgumentOutOfRangeException
could be thrown in situations where a new WebSocket connection is established while a previous connection is in the process of being closed. - If nothing is received from a Unity Relay server for a while, the transport will now attempt to rebind to it. This should improve the accuracy of
GetRelayConnectionStatus
in scenarios where the Relay allocation times out while communications with the server are out. - Fixed an issue where
UDPNetworkInterface
(the default one) would not bind to the correct address if the local IP address change and the socket needs to be recreated (e.g. because the app was backgrounded on a mobile device). - Fixed an issue where
Disconnect
events would fail to be reported correctly for WebSocket connections. - Fixed an issue where, when using Relay, heartbeats would be sent constantly when they are disabled by setting
relayConnectionTimeMS
to 0 in the Relay parameters.
1.3.4
[1.3.4] - 2023-04-27
Fixes
- Fixed an issue where the reliable pipeline stage could end up writing past the end of its internal buffer and thrashing the buffers of other connections. This could result in packet corruption, but would most likely result in erroneous -7 (
NetworkDriverParallelForErr
) errors being reported when callingEndSend
. - Fixed an issue where upon returning -7 (
NetworkDriverParallelForErr
),EndSend
would leak the send handle. Over time, this would result in less send handles being available, resulting in more -5 (NetworkSendQueueFull
) errors. - If nothing is received from a Unity Relay server for a while, the transport will now attempt to rebind to it. This should improve the accuracy of
GetRelayConnectionStatus
in scenarios where the Relay allocation times out while communications with the server are out.
2.0.1
[2.0.1] - 2023-04-17
Changes
- Updated Collections dependency to 2.1.1.
[2.0.0] - 2023-04-14
Changes
NetworkEndpoint.ToString
and its fixed string variant now return "invalid" for invalid endpoints instead of an empty string.- Updated Burst dependency to 1.8.4.
- Updated Collections dependency to 2.1.0.
Fixes
- Fixed an issue where the TLS handshake of a new secure WebSocket connection could possibly fail if there were already other active connections on the same server.