using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
namespace PowerCarsMobileServer
{
class Server
{
public static int Port { get; private set; }
private static TcpListener tcpListener;
public static ServerSocket serverSocket; //problem is here
public static void Start(int _port)
{
Port = _port;
serverSocket = new ServerSocket(Port);
Console.WriteLine("Starting server...");
InitializeServerData();
tcpListener = new TcpListener(IPAddress.Any, Port);
tcpListener.Start();
Console.WriteLine($"Server started on {Port}.");
}
}
}
When creating a global port, I ran into the problem of not supporting "ServerSocket". Older articles use ServerSocket but I don't understand the problem comparing my code with theirs.
How can I fix it?
I tried to connect different references, but it doesn't work or I didn't find a good one