static void Main(string[] args) { var serverEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), DEFAULT_PORT); var serverListener = new TcpServerListener(serverEndPoint); serverListener.StartListening(OnConnectionAccepted, "Normal"); Console.WriteLine("Server started..."); Console.ReadLine(); }
public SocketRemotingServer(string name, IPEndPoint serverEndPoint, ISocketServerEventListener eventListener = null) { _serverListener = new TcpServerListener(serverEndPoint, eventListener, HandleRemotingRequest); _requestHandlerDict = new Dictionary<int, IRequestHandler>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(name ?? GetType().FullName); }