How to send data to tcp server from command prompt [closed]
Solution 1:
Windows XP used to have a telnet
command that was useful for "quick and dirty" testing if a TCP server was alive and reachable.
telnet {IP-address} {port}
i.e. telnet microsoft.com 80
If no service is listening, you will get an error message. If it's blocked by a firewall, it will timeout.
If the service outputs something upon connection, you will see it. However, it may be waiting for you to send something. In the case above, type GET / http/1.1
, hit enter twice, and you'll see the HTML of http://microsoft.com.
With Windows 7, you can install the "Telnet Client" from Programs and Features -> Turn Windows features on or off, or use PuTTY for this purpose.
You can also use a better tool for this purpose called netcat.