unity smartfoxserver connection error











up vote
30
down vote

favorite
3












I'm using Smartfoxserver api on Unity3d, it was working fine before I recovery my macbook, but now gives a connection error as below :



Http error creating http connection: System.Net.Sockets.SocketException: Connection refused
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.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0
at System.Net.Sockets.TcpClient.Connect (System.Net.IPAddress ipAddresses, Int32 port) [0x00000] in <filename unknown>:0
UnityEngine.Debug:Log(Object)
SFS2X_Connect:OnConnection(BaseEvent) (at Assets/SFS2X_Connect.cs:2758)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
SFS2X_Connect:Update() (at Assets/SFS2X_Connect.cs:2764)


here is connection code:



using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using System.Collections;
using Sfs2X;
using Sfs2X.Core;

public class SFS2X_Connect : MonoBehaviour {

public string Host = "127.0.0.1";

[Tooltip("TCP port listened by the SmartFoxServer 2X instance; used for regular socket connection in all builds except WebGL")]
public int TcpPort = 9933;

[Tooltip("WebSocket port listened by the SmartFoxServer 2X instance; used for in WebGL build only")]
public int WSPort = 8888;

[Tooltip("Name of the SmartFoxServer 2X Zone to join")]
public string Zone = "examplezone";


SmartFox sfs;

sfs = new SmartFox ();

sfs.ThreadSafeMode = false;

sfs.AddEventListener (SFSEvent.CONNECTION, OnConnection);

ConfigData cfg = new ConfigData();

cfg.Host = Host;
cfg.Port = TcpPort;
cfg.Zone = Zone;

sfs.Connect (cfg);
}


I've removed and reimport smartfox.dll but still the same



What can I do?



Note : I create a new project and import smartfoxserver, its connected to server










share|improve this question

















This question had a bounty worth +50
reputation from PrinceOfRavens that ended 5 hours ago. Grace period ends in 18 hours


This question has not received enough attention.












  • 1




    Normally Socket Connection get refused if no services listening on the specified port, or there is a firewall stopping you. Have you checked them?
    – Smartis
    Aug 22 '17 at 7:13










  • @Smartis I added more details to question
    – Muhammet Demir
    Aug 22 '17 at 9:27










  • Have you already configured the server with localhost:8080 ? Whats the message if you type ./sfs2x-service status in your terminal?
    – Smartis
    Aug 22 '17 at 9:41










  • "the deamon is running"
    – Muhammet Demir
    Aug 22 '17 at 9:50










  • And netstat -p tcp | grep $PORT in terminal lists 9933 too? Also please add the constructor of sfs to your question.
    – Smartis
    Aug 22 '17 at 9:53

















up vote
30
down vote

favorite
3












I'm using Smartfoxserver api on Unity3d, it was working fine before I recovery my macbook, but now gives a connection error as below :



Http error creating http connection: System.Net.Sockets.SocketException: Connection refused
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.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0
at System.Net.Sockets.TcpClient.Connect (System.Net.IPAddress ipAddresses, Int32 port) [0x00000] in <filename unknown>:0
UnityEngine.Debug:Log(Object)
SFS2X_Connect:OnConnection(BaseEvent) (at Assets/SFS2X_Connect.cs:2758)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
SFS2X_Connect:Update() (at Assets/SFS2X_Connect.cs:2764)


here is connection code:



using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using System.Collections;
using Sfs2X;
using Sfs2X.Core;

public class SFS2X_Connect : MonoBehaviour {

public string Host = "127.0.0.1";

[Tooltip("TCP port listened by the SmartFoxServer 2X instance; used for regular socket connection in all builds except WebGL")]
public int TcpPort = 9933;

[Tooltip("WebSocket port listened by the SmartFoxServer 2X instance; used for in WebGL build only")]
public int WSPort = 8888;

[Tooltip("Name of the SmartFoxServer 2X Zone to join")]
public string Zone = "examplezone";


SmartFox sfs;

sfs = new SmartFox ();

sfs.ThreadSafeMode = false;

sfs.AddEventListener (SFSEvent.CONNECTION, OnConnection);

ConfigData cfg = new ConfigData();

cfg.Host = Host;
cfg.Port = TcpPort;
cfg.Zone = Zone;

sfs.Connect (cfg);
}


I've removed and reimport smartfox.dll but still the same



What can I do?



Note : I create a new project and import smartfoxserver, its connected to server










share|improve this question

















This question had a bounty worth +50
reputation from PrinceOfRavens that ended 5 hours ago. Grace period ends in 18 hours


This question has not received enough attention.












  • 1




    Normally Socket Connection get refused if no services listening on the specified port, or there is a firewall stopping you. Have you checked them?
    – Smartis
    Aug 22 '17 at 7:13










  • @Smartis I added more details to question
    – Muhammet Demir
    Aug 22 '17 at 9:27










  • Have you already configured the server with localhost:8080 ? Whats the message if you type ./sfs2x-service status in your terminal?
    – Smartis
    Aug 22 '17 at 9:41










  • "the deamon is running"
    – Muhammet Demir
    Aug 22 '17 at 9:50










  • And netstat -p tcp | grep $PORT in terminal lists 9933 too? Also please add the constructor of sfs to your question.
    – Smartis
    Aug 22 '17 at 9:53















up vote
30
down vote

favorite
3









up vote
30
down vote

favorite
3






3





I'm using Smartfoxserver api on Unity3d, it was working fine before I recovery my macbook, but now gives a connection error as below :



Http error creating http connection: System.Net.Sockets.SocketException: Connection refused
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.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0
at System.Net.Sockets.TcpClient.Connect (System.Net.IPAddress ipAddresses, Int32 port) [0x00000] in <filename unknown>:0
UnityEngine.Debug:Log(Object)
SFS2X_Connect:OnConnection(BaseEvent) (at Assets/SFS2X_Connect.cs:2758)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
SFS2X_Connect:Update() (at Assets/SFS2X_Connect.cs:2764)


here is connection code:



using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using System.Collections;
using Sfs2X;
using Sfs2X.Core;

public class SFS2X_Connect : MonoBehaviour {

public string Host = "127.0.0.1";

[Tooltip("TCP port listened by the SmartFoxServer 2X instance; used for regular socket connection in all builds except WebGL")]
public int TcpPort = 9933;

[Tooltip("WebSocket port listened by the SmartFoxServer 2X instance; used for in WebGL build only")]
public int WSPort = 8888;

[Tooltip("Name of the SmartFoxServer 2X Zone to join")]
public string Zone = "examplezone";


SmartFox sfs;

sfs = new SmartFox ();

sfs.ThreadSafeMode = false;

sfs.AddEventListener (SFSEvent.CONNECTION, OnConnection);

ConfigData cfg = new ConfigData();

cfg.Host = Host;
cfg.Port = TcpPort;
cfg.Zone = Zone;

sfs.Connect (cfg);
}


I've removed and reimport smartfox.dll but still the same



What can I do?



Note : I create a new project and import smartfoxserver, its connected to server










share|improve this question















I'm using Smartfoxserver api on Unity3d, it was working fine before I recovery my macbook, but now gives a connection error as below :



Http error creating http connection: System.Net.Sockets.SocketException: Connection refused
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.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0
at System.Net.Sockets.TcpClient.Connect (System.Net.IPAddress ipAddresses, Int32 port) [0x00000] in <filename unknown>:0
UnityEngine.Debug:Log(Object)
SFS2X_Connect:OnConnection(BaseEvent) (at Assets/SFS2X_Connect.cs:2758)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
SFS2X_Connect:Update() (at Assets/SFS2X_Connect.cs:2764)


here is connection code:



using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using System.Collections;
using Sfs2X;
using Sfs2X.Core;

public class SFS2X_Connect : MonoBehaviour {

public string Host = "127.0.0.1";

[Tooltip("TCP port listened by the SmartFoxServer 2X instance; used for regular socket connection in all builds except WebGL")]
public int TcpPort = 9933;

[Tooltip("WebSocket port listened by the SmartFoxServer 2X instance; used for in WebGL build only")]
public int WSPort = 8888;

[Tooltip("Name of the SmartFoxServer 2X Zone to join")]
public string Zone = "examplezone";


SmartFox sfs;

sfs = new SmartFox ();

sfs.ThreadSafeMode = false;

sfs.AddEventListener (SFSEvent.CONNECTION, OnConnection);

ConfigData cfg = new ConfigData();

cfg.Host = Host;
cfg.Port = TcpPort;
cfg.Zone = Zone;

sfs.Connect (cfg);
}


I've removed and reimport smartfox.dll but still the same



What can I do?



Note : I create a new project and import smartfoxserver, its connected to server







c# unity3d smartfoxserver






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 18 at 22:58

























asked Aug 19 '17 at 19:57









Muhammet Demir

7072933




7072933






This question had a bounty worth +50
reputation from PrinceOfRavens that ended 5 hours ago. Grace period ends in 18 hours


This question has not received enough attention.








This question had a bounty worth +50
reputation from PrinceOfRavens that ended 5 hours ago. Grace period ends in 18 hours


This question has not received enough attention.










  • 1




    Normally Socket Connection get refused if no services listening on the specified port, or there is a firewall stopping you. Have you checked them?
    – Smartis
    Aug 22 '17 at 7:13










  • @Smartis I added more details to question
    – Muhammet Demir
    Aug 22 '17 at 9:27










  • Have you already configured the server with localhost:8080 ? Whats the message if you type ./sfs2x-service status in your terminal?
    – Smartis
    Aug 22 '17 at 9:41










  • "the deamon is running"
    – Muhammet Demir
    Aug 22 '17 at 9:50










  • And netstat -p tcp | grep $PORT in terminal lists 9933 too? Also please add the constructor of sfs to your question.
    – Smartis
    Aug 22 '17 at 9:53
















  • 1




    Normally Socket Connection get refused if no services listening on the specified port, or there is a firewall stopping you. Have you checked them?
    – Smartis
    Aug 22 '17 at 7:13










  • @Smartis I added more details to question
    – Muhammet Demir
    Aug 22 '17 at 9:27










  • Have you already configured the server with localhost:8080 ? Whats the message if you type ./sfs2x-service status in your terminal?
    – Smartis
    Aug 22 '17 at 9:41










  • "the deamon is running"
    – Muhammet Demir
    Aug 22 '17 at 9:50










  • And netstat -p tcp | grep $PORT in terminal lists 9933 too? Also please add the constructor of sfs to your question.
    – Smartis
    Aug 22 '17 at 9:53










1




1




Normally Socket Connection get refused if no services listening on the specified port, or there is a firewall stopping you. Have you checked them?
– Smartis
Aug 22 '17 at 7:13




Normally Socket Connection get refused if no services listening on the specified port, or there is a firewall stopping you. Have you checked them?
– Smartis
Aug 22 '17 at 7:13












@Smartis I added more details to question
– Muhammet Demir
Aug 22 '17 at 9:27




@Smartis I added more details to question
– Muhammet Demir
Aug 22 '17 at 9:27












Have you already configured the server with localhost:8080 ? Whats the message if you type ./sfs2x-service status in your terminal?
– Smartis
Aug 22 '17 at 9:41




Have you already configured the server with localhost:8080 ? Whats the message if you type ./sfs2x-service status in your terminal?
– Smartis
Aug 22 '17 at 9:41












"the deamon is running"
– Muhammet Demir
Aug 22 '17 at 9:50




"the deamon is running"
– Muhammet Demir
Aug 22 '17 at 9:50












And netstat -p tcp | grep $PORT in terminal lists 9933 too? Also please add the constructor of sfs to your question.
– Smartis
Aug 22 '17 at 9:53






And netstat -p tcp | grep $PORT in terminal lists 9933 too? Also please add the constructor of sfs to your question.
– Smartis
Aug 22 '17 at 9:53



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45775780%2funity-smartfoxserver-connection-error%23new-answer', 'question_page');
}
);

Post as a guest





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45775780%2funity-smartfoxserver-connection-error%23new-answer', 'question_page');
}
);

Post as a guest




















































































這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()