windows 如何使用命令行建立套接字连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20346456/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to establish socket connection using the command line
提问by Shiva
How can I establish my socket connection using the Windows command line?
如何使用 Windows 命令行建立套接字连接?
For example, my socket IP and port num is 192.168.1.180:9760
例如,我的套接字 IP 和端口号是 192.168.1.180:9760
I just want to send commands to that IP from the command line.
我只想从命令行向该 IP 发送命令。
回答by Scary Wombat
You can use telnet as in
您可以使用 telnet 作为
telnet 192.168.1.180 9760
回答by Mark Setchell
You can use "netcat", or "nc" as it is sometimes called.
您可以使用“netcat”或“nc”,因为它有时被称为。
So if the server is using UDP on port 9760, you can use:
因此,如果服务器在端口 9760 上使用 UDP,则可以使用:
nc -u 192.168.1.180 9760