1,105,295 Community Members

Client/Server read & write. Finger Protocol

Member Avatar
mbirum
Newbie Poster
2 posts since Nov 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
mbirum
Newbie Poster
2 posts since Nov 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

****
bufferSize = 1024;

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: