Exemplo n.º 1
0
        private static void BoltSocket()
        {
            _serverSocket = new ServerSocket();
            _serverSocket.AddMessageHandler<RequestMessage>(RequestHandler);
            _serverSocket.Bind("tcp://127.0.0.1:9900");
            Console.ReadLine();

            _serverSocket.Close();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            ServerSocket.Bind(6556);
            ServerSocket.Listen(500);
            ServerSocket.Accept();

            while (true)
            {
                Console.ReadLine();
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            ServerSocket server = new ServerSocket();

            server.Bind(1029);
            server.Listen(5);
            server.Accept();
            while (true)
            {
                Console.ReadKey();
            }
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            ServerSocket server = new ServerSocket();

            server.Bind("127.0.0.1", 1043);
            server.Listen(1);
            server.Accept();
            while (server.IsConnected)
            {
                server.Receive();
            }
        }
Exemplo n.º 5
0
 public Server(int serverPort)
 {
     this.ServerMysterio = new Mysterio(2048);
     this.ClientMysterio = new Mysterio();
     this.ServerPort     = serverPort;
     this.IpEndPoint     = new IPEndPoint(IPAddress.Any, serverPort);
     try
     {
         this.ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
         ServerSocket.Bind(this.IpEndPoint);
         Start();
     }
     catch (Exception e)
     {
         Stop();
         Console.WriteLine(e.Message);
     }
 }
Exemplo n.º 6
0
Arquivo: Form1.cs Projeto: rLoka/RAT
 //Metoda koja binda socket i sluša konekcije
 private void btnSlusajKonekcije_Click(object sender, EventArgs e)
 {
     try
     {
         //Server socket prvo bindamo na port
         ServerSocket.Bind(defaultPort);
         //Slušamo ulazne konekcije
         ServerSocket.Listen(500);
         //Prihvaćamo konekcije
         ServerSocket.Accept();
         lblStatusLabel.Text = "Slušam konekcije na portu " + defaultPort;
         btnRefreshClientList_Click();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Trenutno nije moguće slušati na konekcije!",
                         "Greška",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }