We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,520 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Client/Server read & write. Finger Protocol

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

1
Contributor
1
Reply
3 Minutes
Discussion Span
1 Year Ago
Last Updated
2
Views
mbirum
Newbie Poster
2 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

****
bufferSize = 1024;

mbirum
Newbie Poster
2 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0587 seconds using 2.71MB