/// <summary>
 /// ctor.
 /// </summary>
 /// <param name="endPoint">конечная точка подключения на сервере</param>
 public KnowledgeBase(IPEndPoint endPoint)
 {
     sctpClient = new SctpClient(endPoint);
     sctpClient.Connect();
     arcs     = new ElementCollection <Arc>(this);
     nodes    = new ElementCollection <Node>(this);
     links    = new ElementCollection <Link>(this);
     commands = new Commands(this);
 }
        private void Connect()
        {
            const string defaultAddress = SctpProtocol.TestServerIp;
            string       serverAddress  = defaultAddress;
            int          serverPort     = SctpProtocol.DefaultPortNumber;

            sctpClient = new SctpClient(serverAddress, serverPort);
            //подписываемся на событие, если планируем использовать асинхронный клиент
            sctpClient.ResponseReceived += asyncHandler;
            //подключаемся
            sctpClient.Connect();
        }
        public void TestSocketConnect()
        {
            SctpClient sctpClient;
            const string defaultAddress = SctpProtocol.TestServerIp;
            string serverAddress = defaultAddress;
            int serverPort = SctpProtocol.DefaultPortNumber;
            sctpClient = new SctpClient(serverAddress, serverPort);

            sctpClient.Connect();
            Assert.AreEqual(true, sctpClient.IsConnected, "Подключение не удалось");
            Assert.AreEqual(SctpProtocol.TestServerIp, sctpClient.ServerEndPoint.Address.ToString());
            Assert.AreEqual(SctpProtocol.DefaultPortNumber, sctpClient.ServerEndPoint.Port);

        }
Beispiel #4
0
 public CostTest(string address, int port)
 {
     client = new SctpClient(address, port);
     client.Connect();
 }
Beispiel #5
0
 public CostTest(string address, int port)
 {
     client = new SctpClient(address, port);
     client.Connect();
 }