using System;
using System.IO;
using System.Text;
using System.Net;
using System.Net.Sockets;

public class Program
{
    public static void Main(string[] args)
    {
        Console.WriteLine("Server");

        TcpClient serverSocket = new TcpClient("localhost", 9000);

        NetworkStream ns = serverSocket.GetStream();

        StreamReader sr = new StreamReader(ns);
        StreamWriter sw = new StreamWriter(ns);

        sw.Write("Data over Network from Server");

        string textout = sr.ReadLine();

        Console.WriteLine(textout);

        sw.Flush();
        sw.Close();
        ns.Close();

        Console.ReadLine();
    }
}
