UDP and excessive Policy server checks

I have my Unity 2.6 project now working with the extra WebPlayer Security policy checks required for a 3.0 Webplayer. My Unity app uses UDP for network communication, however whilst running in the Web Player my applications log file is now filled with hundreds of policy check lines such as…

Checking InterNetwork:18:{35,40,9,20,151,43,0,0,0,0,0,0,0,0,0,0\0
Policy for host found in the cache

Building a release version of the WebPlayer doesnt seem to get rid of log messages.

I’m worried that these endless checks are affecting the performance in my application, it may not be related but under 3.0 I am now seeing UDP connection issues where i previously did not.

The new Security Sandbox documentation says

"When using UDP connections the policy can also be auto fetched when they need to be enforced in a similar manner as with TCP. The difference is that auto fetching with TCP happens when you Connect to something (ensures you are allowed to connect to a server), but with UDP, since it’s connectionless, it also happens when you call any API point which sends or receives data (ensures you are allowed to send/receive traffic to/from a server). "

This insinuates that the policy is checked EVERY time a UDP packet is sent or received. Which would match up with the vast amounts of log messages I see now.

This can’t be the most efficient way of doing of doing these checks ? Or they should at least not log them for a non debug build as this will add a lot of IO overhead.

(Also for SecurityException Errors about there being no valid crossdomain policy it would be nice to be told the IP address where the policy is missing from in the error message)

many thanks,
Rob

it has nothing to do with efficient. it has to do that any connection building has to be verified against the policy and in case of udp this means on every call (as the policy could be voided at any time. if that happens on tcp connections then the tcp side is voided along it)

use tcp if you don’t want that as tcp is a connection protocol

Thanks for the answer, but it does have to do with efficiency, any delay in sending/receiving UDP packets could cause additional network lag when scaled to an environment with lots of players.

I unfortunately don’t have the option of using tcp, the server system I communicate uses UDP and cannot be changed by myself as it is a third party product. Even if it could be changed tcp is not the right choice for sending player updates etc.

At the least messages should not be written to the log for non debug webplayer builds.

I’m interested in what you mean by “as the policy could be voided at any time” ?