WebGL重连
This commit is contained in:
parent
9dcbacca61
commit
c83dea2f63
@ -161,10 +161,12 @@ public class SocketConn
|
||||
string address = "";
|
||||
if (CommonUtil.IsValidIPv4(host))
|
||||
{
|
||||
port = 6412;
|
||||
address = string.Format("ws://{0}:{1}", host, 6412);
|
||||
}
|
||||
else
|
||||
{
|
||||
port = 4430;
|
||||
address = string.Format("wss://{0}:{1}", host, 4430);
|
||||
}
|
||||
m_address = address;
|
||||
@ -230,8 +232,8 @@ public class SocketConn
|
||||
try
|
||||
{
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
m_address = string.Format("ws://{0}:{1}", mLastIP, mLastPort);
|
||||
Debug.LogWarning("Begin connect to Socket Address :" + m_address);
|
||||
//m_address = string.Format("ws://{0}:{1}", mLastIP, mLastPort);
|
||||
Debug.LogWarning("Begin reconnect to Socket Address :" + m_address);
|
||||
m_iSocket = new WebSocket(m_address);
|
||||
m_iSocket.OnOpen += Socket_OnOpen;
|
||||
m_iSocket.OnMessage += Socket_OnMessage;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user