Hi all,
I'm running a C# script in Unity 3.1.0f4, connecting to a remote server. The web-player build run from a browser generates the following error message -
MethodAccessException: Attempt to access a private/protected method failed.
at System.Security.SecurityManager.ThrowException (System.Exception ex) [0x00000] in <filename unknown>:0
at [Some constructor in my code]
The code looks like this:
Socket.Connect(hostname, port); //works
NetworkStream netStream = Socket.GetStream();//works
BufferedStream bStream = new BufferedStream(netStream);//seems to fail
When I, however, start the same project in the Editor, (with platform switched to web player, of course) it works without problems. It only occurs using the browser-plugin.
Even if I replace the `NetworkStream` with a `MemoryStream`, it fails when constructing the `BufferedStream`:
Socket.Connect(hostname, port); //works
NetworkStream netStream = Socket.GetStream();//works
MemoryStream test = new MemoryStream();//works as well
BufferedStream bStream = new BufferedStream(test);// also fails
As far as I could read from the documentation, both classes `MemoryStream` and `BufferedStream` are fully supported by the web player. `NetworkStream` is accessible as well, just the `close(timeout)` method is not - which I'm not using anyway.
Thanks for all hints :)