title: Need to send [syn, ack ] packet over TCP
body: <p>I need to make my PC reply to a windows application which is sending [SYN] packet constantly and expecting [SYN, ACK] from my PC. My goal is to record messages received from that application using wireshark. For that I need to write an application which can send reply to that PC. I am not experienced in TCP protocol, so need suggestions how can I send [SYN, ACK] reply with some C# code?
  <a href="https://i.stack.imgur.com/tcG32.png" rel="nofollow noreferrer">Wireshark Capture</a></p>
  
  <pre><code>namespace TCP_CLIENT
  {
      class Program
      {
          const int PORT_NO = 5000;
          const string SERVER_IP = "192.168.1.100";
  
          static void Main(string[] args)
          {
              //---listen at the specified IP and port no.---
              IPAddress localAdd = IPAddress.Parse(SERVER_IP);
              TcpListener listener = new TcpListener(localAdd, PORT_NO);
              Console.WriteLine("Listening...");
              listener.Start();
          }
      }
  }
  </code></pre>