Пример #1
0
        // Constructor
        public Connector(string AHost, int APort, string AUsername, string APassword)
        {
            TCPClient = new TCP.Client(AHost, APort, AUsername, APassword);

            // Initial Connect to check if connection to server is possible.
            if (!TCPClient.Connect())
            {
                throw new System.InvalidOperationException("Cannot connect to Server");
            }
        }
Пример #2
0
        public override void Initialize(string file)
        {
            Config.Configuration config = new Config.Configuration(file);
            protocol = (IProtocolParse)ObjectFactory.CreateInstance(config.Type);

            ip = config.IP;
            port = config.Port;

            client = new Client("192.168.10.103", 2000);
            client.OnReceive += new ReceiveEventHandler(client_OnReceive);
            client.Connect();

            //client.Write("9876543210");

            //string s = client.Read();
        }
Пример #3
0
 static void Main(string[] args)
 {
     var client = new Client(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 11000));
 }