예제 #1
0
        static void Main(string[] args)
        {
            try
            {
                ServiceClient sc = new ServiceClient();
                Console.WriteLine(sc.Ping());

                Service2Client sc2 = new Service2Client();
                Console.WriteLine(sc2.Ping2());

                //Console.WriteLine("Sending...");
                //int chunkSize = 16777216;
                //int totalSize = 134217728;
                //byte[] data = new byte[chunkSize];
                //for (int i = 0; i < totalSize; i += chunkSize)
                //    sc.Send(data);
                //Console.WriteLine("Sent.");

                Console.WriteLine("\nPress <any key> to continue.");
                Console.ReadKey(true);

                sc.Close();
            }
            catch (Exception ex)
            {
                while (ex != null)
                {
                    Console.WriteLine(ex.Message);
                    ex = ex.InnerException;
                }

                Console.ReadKey(true);
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            try
            {
                ServiceClient sc = new ServiceClient();
                Console.WriteLine(sc.Ping());

                Service2Client sc2 = new Service2Client();
                Console.WriteLine(sc2.Ping2());

                //Console.WriteLine("Sending...");
                //int chunkSize = 16777216;
                //int totalSize = 134217728;
                //byte[] data = new byte[chunkSize];
                //for (int i = 0; i < totalSize; i += chunkSize)
                //    sc.Send(data);
                //Console.WriteLine("Sent.");

                Console.WriteLine("\nPress <any key> to continue.");
                Console.ReadKey(true);

                sc.Close();
            }
            catch (Exception ex)
            {
                while (ex != null)
                {
                    Console.WriteLine(ex.Message);
                    ex = ex.InnerException;
                }

                Console.ReadKey(true);
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            ServiceClient client = new ServiceClient();

            try
            {
                client.Open();
                writeConsole(client.GetData(3));
                client.Close();
            }
            catch
            {
            }

            System.Threading.Thread.Sleep(5000);
        }
예제 #4
0
        static void Main(string[] args)
        {
            ServiceClient client = new ServiceClient();

            Console.WriteLine("enter end to exit");
            while (true)
            {
                string Message = Console.ReadLine();
                if (Message == "end")
                {
                    break;
                }

                var kyr = client.RecieveMessage(Message);
            }
            client.Close();
            Console.ReadLine();
        }