96 return (TRUE);
97 }
98 int main(int argc, char *argv[])
99 {
100 int port = 777;
101 char* targetip;
102 char* output = NULL;
103
104
if (argc < 2)
105 {
106 printf("ServerApp usage:\r\n");
107 printf(" %s [port]\r\n", argv[0]);
108 return(0);
109 }
110
111
targetip = argv[1];
112 if (argc >= 2)
113 {
114 port = atoi(argv[1]);
115 }
116
117
bool up = TRUE;
118 char sendStr[STRING_MAX];
119
120
strcpy(sendStr, "\r\n Hello World! \r\n\r\n");
121
122
printf("Starting Server...\n");
123
124
do
125 {
126 up = server(port, sendStr);
127 }while(up);
128
129
return(0);
130 }
With ClientApp.exe and ServerApp.exe working, you can test them on each other.
Open up two command prompts.At the first command prompt, run the ServerApp.exe
on any port you like. If you do not add a value, it will ...