title: C# Socket Programming: how to identify client by name not by IP
body: <p>I am new to socket Programming. I'm developing a Client-Server Communication Program and having difficulty with Showing Client Name instead of IP address when client gets connected to the Server. Can anyone suggest me a good approach? How I can do that? I need that IP as well for further communication.
  Here's my Client Side Code:</p>
  
  <pre><code>mTcpClient = new TcpClient();
  mTcpClient.BeginConnect(ipa, nPort, onCompleteConnect, mTcpClient);
  </code></pre>
  
  <p>And that onCompleteConnect function:</p>
  
  <pre><code>void onCompleteConnect(IAsyncResult iar)
      {
  
          TcpClient tcpc;
  
          try
          {
              tcpc = (TcpClient)iar.AsyncState;
              tcpc.EndConnect(iar);
              mRx = new byte[512];
              tcpc.GetStream().BeginRead(mRx, 0, mRx.Length, onCompleteReadFromServerStream, tcpc);
  
          }
          catch (Exception exc)
          {
              MessageBox.Show(exc.Message);
          }
      }
  </code></pre>
  
  <p>Now, I want to send Client Name as Well and Receive at Server Side. What should I do?</p>