35 fprintf(stderr,
"Sockets_Test is portnum\n");
36 fprintf(stderr,
"Sockets_Test ic portnum hostname\n");
40 int main(
int argc,
char * argv[])
48 if(strncmp(argv[1],
"is", 2) == 0) {
50 portnum = atoi(argv[2]);
53 while(con_count < 20) {
61 while((rsize = s->
getLine(buf, 1024)) >= 0) {
64 std::cout << boost::format(
"Got line [%s] RC = %d\n") % buf % retcount;
71 std::cout <<
"Disconnect." << std::endl;
74 else if (strncmp(argv[1],
"ic", 2) == 0) {
75 std::cout <<
"No idea what to do here." << std::endl;
int getLine(char *buf, unsigned int maxsize)
capture a newline-terminated buffer from the socket This is a non-blocking method.
int main(int argc, char *argv[])
This is an IP socket that returns newline-delimited strings arriving on the socket.