1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
415 B

#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;
}