Files
2023-10-13 14:01:41 +00:00

26 lines
415 B
C++

#include <signal.h>
#include "tcp_client.h"
void sig_exit(int s)
{
exit(0);
}
int main(int argc, char* argv[])
{
if (argc != 4) {
fprintf(stderr, "Usage: ./client ip port message");
return 0;
}
signal(SIGINT, sig_exit);
TCPClient tcpClient;
tcpClient.Setup(argv[1], atoi(argv[2]));
while (1) {
tcpClient.Send(argv[3]);
sleep(1);
}
return 0;
}