tcping.exe is a console application that operates similarly to 'ping', however it works over a tcp port. There are many different implementions of this floating around, written independently by different people. There are many like it, but this one is mine.
首先安装 Visual Studio Code 和 TDM Gcc
- 修改三处:
CXXFLAGSLDFLAGSAPPNAME参考如下
# Compiler settings - Can be customized.
CC = g++
CXXFLAGS = -std=c++11 -Wall -O2 -s -shared-libstdc++
# -fexec-charset=gbk -finput-charset=UTF-8 -O2 -s -shared-libstdc++ -m64 -m32
LDFLAGS = -lws2_32
# Makefile settings - Can be customized.
APPNAME = tcping
EXT = .cpp
SRCDIR = .
OBJDIR = .
D:\TDM-GCC-64\bin\mingw32-make.exe复制副本,改名成make.exe- VS Code 新建终端,如演示动画,输入
make命令进行编译
tcping 是一个控制台应用程序,其操作类似于“ping”,但它通过 tcp 端口工作。