title: How to find out client is connecting to my server through telnet?
body: <p>I'm writing a <code>ServerSocket</code> in java. I want to send some special content to client connecting to me through <code>telnet</code>. I want to send other content if he/she connects through Browser and etc. Is there any way to find out that user is connecting to me with <code>telnet</code>?</p>
  
  <p>My code : </p>
  
  <pre><code>public void handleConnection(Socket socket) throws IOException {
      String author = "Ehsan Akbari";
      BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
      PrintWriter out = new PrintWriter(socket.getOutputStream(),true);
      if(checkoutClientType(socket)=="telnet")
          out.println("You are connecting through telnet :\)");
      else
          out.println("You are not connecting through telnet :|");
  }
  </code></pre>
  
  <p>What should be the definition of <code>checkoutClientType(Socket s);</code>?</p>