OK - time to give things a "name".
There is a "reconnect issue". That is when in the webplayer you close a tab with a Unity player, open again and try to establish the connection again.
Then there is a "crash on close". After having run http communication, then browser crashes on exit (as well as the stand alone player).
On the reconnect issue I've tried printing out the caught exception - and wow thats a strange one.
[SFS DEBUG] Got this http exception: System.NotSupportedException:
http://localhost:8080/bluebox/httpbox.do
at System.Net.WebRequest.GetCreator (System.String prefix) [0x00000]
at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000]
at System.Net.WebRequest.Create (System.String requestUriString) [0x00000]
at SmartFoxClientAPI.Http.HttpConnection.HttpSend (System.String message) [0x00000]
Googling this doesnt give me any clue at all. Anyone ever seen one of these before and know what it means? Besides the obvious MSDN explaination. Obviously a WebRequest create from string works - so why does it throw an NotSupported exception the second time?
On the crash on close I think I have found the problem. WebRequest internally uses the async connection stuff - ARGH! This means that I cannot use the WebRequest class for http, as this will trigger the Unity/mono close crash bug that also haunted the socket connections in beta 1.
I got to think a bit about this, but it will basically mean that the only option here is to make a Unity specific failover using the Unity WWW class instead - which renders the API unusable for non-Unity clients. Bah
Another way to solve this would be to implement my own http class using bare sockets. Would be a portable solution, and HTTP protocol isnt that hard to code. Hmmm