I'm trying to change the smartfox port on my remote server to port 443... this works fine in standalone builds... as soon as i switch to web player i run into problems...
In fact, i've tried a few different ports (443, 80, 9932) and they all give problems, port 9933 gives no problem at all.
Here is my client code:
Code: Select all
if (Security.PrefetchSocketPolicy(SERVER_IP, Convert.ToInt32(SERVER_PORT), 500))
Debug.Log("good!");
else
Debug.Log("bad!");
smartfox = new SmartFox(true);
smartfox.Connect(SERVER_IP, SERVER_PORT);
in my config file on the server:
Code: Select all
<socket address="x.x.x.x" port="443" type="TCP"/>
<socket address="x.x.x.x" port="9933" type="TCP"/>
<socket address="x.x.x.x" port="80" type="TCP"/>
<socket address="x.x.x.x" port="9932" type="TCP"/>
When the server starts up it shows this:
Code: Select all
20:10:21,209 INFO [main] v2.SmartFoxServer - Listening Sockets: { x.x.x.x:443, (Tcp) } { x.x.x.x:9933, (Tcp) } { x.x.x.x:80, (Tcp) } { x.x.x.x:9932, (Tcp) }
=======================================================
Client:
-----------------------------------------------------------------
When I connect to port 9933, everything works fine as expected...
------------------------------------------------------------------
When I connect to port 9932 or port 80 (output is the same for both ports)
server output:
Code: Select all
20:12:30,696 DEBUG [SocketReader] protocol.SFSIoHandler - Handling Flash Policy request
20:12:30,776 DEBUG [SocketReader] v2.SmartFoxServer - []
client output:
Code: Select all
good!
UnityEngine.Debug:Log(Object)
[SFS DEBUG] TCPSocketLayer: General exception on connection: Unable to connect, as no valid crossdomain policy was found at System.Net.Sockets.Socket.Connect_internal (IntPtr sock, System.Net.SocketAddress sa, System.Int32& error, Boolean requireSocketPolicyFile) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0
UnityEngine.Debug:Log(Object)
GameManager:OnDebugMessage(BaseEvent) (at Assets/Scripts/GameManager.cs:65)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
GameManager:FixedUpdate() (at Assets/Scripts/GameManager.cs:137)
------------------------------------------------------------------
When I try on port 443:
Server output: Nothing!
Client Output:
Code: Select all
bad!
UnityEngine.Debug:Log(Object)
[SFS DEBUG] TCPSocketLayer: General exception on connection: Unable to connect, as no valid crossdomain policy was found at System.Net.Sockets.Socket.Connect_internal (IntPtr sock, System.Net.SocketAddress sa, System.Int32& error, Boolean requireSocketPolicyFile) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0
UnityEngine.Debug:Log(Object)
GameManager:OnDebugMessage(BaseEvent) (at Assets/Scripts/GameManager.cs:65)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
GameManager:FixedUpdate() (at Assets/Scripts/GameManager.cs:137)
I've spent all day trying to get this to work... ive tried on 2 completely different linux servers (one with redhat and cpanel, one with centos and no cpanel).....
please help me fix this problem its very frustrating. Why does port 9933 work so easily, while other ports (even 9932) cause so much problems?
Thanks.