title: Client send message server not received message in tcp/ip socket program
body: <p>TCP/IP socket program client send text server receive and store database table. I'm righting code below but i have error text reeving time.</p>
  
  <h2>This is Client Side Code</h2>
  
  <pre><code>    using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using System.Net;
      using System.Net.Sockets;
      using System.Threading.Tasks;
      using System.IO;
  
  
      namespace ClientApplication
      {
          class Client
          {
              static void Main(string[] args)
              {
                  try
                  {
                      TcpClient tcpclnt = new TcpClient();
                      Console.WriteLine("Connecting.....");
  
                      //tcpclnt.Connect("162.144.85.232", 8080);
                      tcpclnt.Connect("162.144.85.232", 4489);
  
  
                      Console.WriteLine("Connected");
                      Console.Write("Enter the string to be Sent : ");
  
                      String str = Console.ReadLine();
                      Stream stm = tcpclnt.GetStream();
  
                      ASCIIEncoding asen = new ASCIIEncoding();
                      byte[] ba = asen.GetBytes(str);
                      System.Net.ServicePointManager.Expect100Continue = false;
                     Console.WriteLine("Sending.....");
  
                      stm.Write(ba, 0, ba.Length);
  
                      byte[] bb = new byte[100];
                      int k = stm.Read(bb, 0, 100);
  
                      for (int i = 0; i &lt; k; i++)
                          Console.Write(Convert.ToChar(bb[i]));
  
                      Console.ReadLine();
  
                      tcpclnt.Close();
                      Console.ReadLine();
                  }
  
                  catch (Exception e)
                  {
                      Console.WriteLine("Error..... " + e.StackTrace);
                      Console.ReadLine();
                  }
              }
      }
      }
  </code></pre>
  
  <h2>This Is Server Side Code</h2>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Net;
  using System.Net.Sockets;
  
  namespace ServerApplication
  {
      class Server
      {
          static void Main(string[] args)
          {
              try
              {
                  IPAddress ipadd = IPAddress.Parse("192.168.1.7");
                  TcpListener list = new TcpListener(ipadd, 8080);
                  list.Start();
                  Console.WriteLine("The server is running at port 8080...");
                  Console.WriteLine("The Local End point Is:" + list.LocalEndpoint);
                  System.Net.ServicePointManager.Expect100Continue = false;
                  Socket s = list.AcceptSocket();
                  Console.WriteLine("Connections Accepted from:" + s.RemoteEndPoint);
                  byte[] b = new byte[100];
                  int k = s.Receive(b);
                  Console.WriteLine("Recived...");
                  for (int i = 0; i &lt; k; i++)
                  Console.WriteLine(Convert.ToChar(b[i]));
                  ASCIIEncoding asen = new ASCIIEncoding();
                  s.Send(asen.GetBytes("The String Was Recived throw Server"));
                  Console.WriteLine("\n Sent Acknowlegment");
                  s.Close();
                  list.Stop();
  
  
              }
              catch (Exception e)
              {
                  Console.WriteLine("Error..... " + e.StackTrace);
  
              }
  
          }
  }
  }
  </code></pre>
  
  <p>I'm trying to execute this code i have error happen like this 
  Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. Please resolve my issue .</p>