Hello,

I have a project in which I have to write a client program for the finger protocol.
It's a very, very basic program which covers the basic socket() connect()
connectToHost() and read()/write() functions. I am having a small problem which
I cannot figure out. My program compiles perfectly, no errors, but there is no output
after I read in from the server. My write statements look something like:

ToServer = argv[k];
write(socketNo, ToServer, bufferSize);
write(socketNo, "\n", bufferSize;

and then my read statements, which i think are where the problem is occuring:

n = read(socketNo, FromServer, bufferSize);
while (n != 0)
{
   n = read(socketNo, FromServer, bufferSize);
   cout << FromServer << endl;
}

Please help, thanks in advance

****
bufferSize = 1024;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.