예제 #1
0
		public static async Task Client()
		{
			try {
				using (var client = new Tcp()) {
					await client.ConnectAsync(Default.IPEndPoint);

					client.Write("Labas Pasauli!");
					var str = await client.ReadStringAsync();
					Console.WriteLine("From Server: {0}", str);
				}
			} catch (Exception e) {
				Console.WriteLine("Client Exception:");
				Console.WriteLine(e);
			}
		}
예제 #2
0
		public static async Task Client()
		{
			try {
				var client = new Tcp();
				await client.ConnectAsync(ep);

				client.Write(Encoding.ASCII, "Labas Pasauli!");
				var str = await client.ReadStringAsync();
				Console.WriteLine("From Server: {0}", str);

				client.Shutdown();
			} catch (Exception e) {
				Console.WriteLine("Client Exception:");
				Console.WriteLine(e);
			}
		}