3

I am writing this to find out why the code below is resulting in failed setup for supersocket server.

    var appServer = new AppServer();
    if (!appServer.Setup(8080)){
        MessageBox.Show("Failed!");
    }

I have added rule in firewall that allows port 8080 since my firewall is enabled by company IT. Don't know why the setup fails. Is there an explanation?

Luicy
  • 23
  • 1
  • 14
  • 3
    if you enable the logging for debug and error it might show the error in the log files - but from the Port Number 8080 it seems like this port is being used by some program - try another port number e.g. 9199 – Dawood Awan Feb 21 '18 at 06:20
  • Not as much Ez pz with little info provided, post the debug log. – Munim Munna Feb 28 '18 at 14:09
  • @Luicy, you should provide the exception details/stack trace or additional info else the bounty is wasted – Tarun Lalwani Mar 06 '18 at 19:30

1 Answers1

3

In testing this locally in a console application using the following (requires NuGet packages SuperSocket and SuperSocket.Engine;

namespace SupersocketTest
{
    using System;
    using SuperSocket.SocketBase;

    class Program
    {
        static void Main(string[] args)
        {
            var server = new AppServer();
            bool success = server.Setup(8080);
            Console.WriteLine($"Server setup: {success}");
            Console.ReadKey();
        }
    }
}

The operation completes successfully.

Looking at the code online, the underlying connection is still Socket based (as the name of the package implies). As such, it's subject to all the rules around how sockets work normally in .NET.

Things that can cause a Socket fail to be set up are (but not limited to)

  • The socket is in use
  • The socket has been closed
  • The OS has run out of available sockets (not likely but technically possible)

Without more detail on the exception you're getting I can only guess but I suspect that the socket is in use as 8080 is a common alternative to 80 that another application could be using.

DiskJunky
  • 4,750
  • 3
  • 37
  • 66