Unable to run application on photon Server
Options
I have an empty gameobject to which ive attached the following script.I get the following error
"Connect() to '192.168.1.101' failed: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it."
The photon server version is 3.
using UnityEngine;
public class Connect :Photon.PunBehaviour{
bool isConnecting;
// Use this for initialization
void Start () {
Debug.Log("Start");
connect();
}
private void Awake()
{
PhotonNetwork.autoJoinLobby = true;
}
public void connect()
{
isConnecting = true;
Debug.Log("Connected");
if (PhotonNetwork.connected)
{
Debug.Log("Connected to photon network");
PhotonNetwork.JoinRandomRoom();
}
else
{
PhotonNetwork.ConnectUsingSettings("1.1"); //game is networked and conncted to photon cloud
}
}
public override void OnJoinedRoom()
{ Debug.Log("We are in Room for 1");
PhotonNetwork.LoadLevel("Room for 1");
}
}
"Connect() to '192.168.1.101' failed: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it."
The photon server version is 3.
using UnityEngine;
public class Connect :Photon.PunBehaviour{
bool isConnecting;
// Use this for initialization
void Start () {
Debug.Log("Start");
connect();
}
private void Awake()
{
PhotonNetwork.autoJoinLobby = true;
}
public void connect()
{
isConnecting = true;
Debug.Log("Connected");
if (PhotonNetwork.connected)
{
Debug.Log("Connected to photon network");
PhotonNetwork.JoinRandomRoom();
}
else
{
PhotonNetwork.ConnectUsingSettings("1.1"); //game is networked and conncted to photon cloud
}
}
public override void OnJoinedRoom()
{ Debug.Log("We are in Room for 1");
PhotonNetwork.LoadLevel("Room for 1");
}
}
0
Comments
-
Hi, @its_me0978
here is basic docs and tutorials:
https://doc.photonengine.com/en-us/onpremise/current/getting-started/photon-server-in-5min
i should admit, that we do not support version 3, please upgrade to 4. but from configuration point of view they are same.
i can not say what is wrong for you, but usually it might be next thigns:
1. firewall
2. listeners setup
in order to say something i need to see your PhotonServer.config, and logs from deploy/log and deploy/bin_win64/log folders
best,
ilya0