How exactly do I send the messages to an NNTP server? Say I telnet to one, then type "HELP" and press enter. What exactly gets sent when I do that? What do I need to append to my "HELP". I think it''s got something to do with the sort of newline I''m using...
I looked at some docs and it says to send a CR-LF, but isn''t that what \n does? Didn''t seem to work :/
Any ideas?
-Agent1
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
The telnet client would send "HELP\n" AFAIK. This is _not_ CR-LF, CR-LF would be "HELP\r\n".
cu,
Prefect
One line of sourcecode says more than a thousand words.
cu,
Prefect
One line of sourcecode says more than a thousand words.
Since I tried both, I''m starting to think I''m not sending properly.
Now, I''ve tried with out being a const char*, const char out[512] as well and neither worked. Could I just not be waiting long enough? Maybe recv() is not recieving anything...
-Agent1
bool CSocks::Send(char out[512]){ send(this->s, out, sizeof(out), 0); printf("SEND: %s\0", out); return true;}
Now, I''ve tried with out being a const char*, const char out[512] as well and neither worked. Could I just not be waiting long enough? Maybe recv() is not recieving anything...
-Agent1
Something like this should work:
int main(...){ CSocks sock; //init sock and connect sock.Send("LIST\r\n");}bool CSocks::Send(char *pOut){ send(this->s, pOut, strlen(pOut), 0); printf("SEND: %s", pOut); return true;}
You want to send "\r\n" at the end of each line.
This is what I use, and I wrote Power-Post 2000 (the most widely used newsgroup binary auto-posting apps for windows.)
NNTP is pretty simple and straightforward, otherwise. The only little thing to remember is that if you are reading a message, you need to strip the first period (".") from each line you receive that starts with a period. If you are posting a message, and the line begins with a period, you must insert an extra period at the beginning of the line. A line with a single period is used to indicate the end of a message.
You might want to check out my web site for Power-Post at www.cosmicwolf.com. I don''t have a lot of time to update the program, so I will probably be posting the complete source code there.
Cheers!
// CHRIS
This is what I use, and I wrote Power-Post 2000 (the most widely used newsgroup binary auto-posting apps for windows.)
NNTP is pretty simple and straightforward, otherwise. The only little thing to remember is that if you are reading a message, you need to strip the first period (".") from each line you receive that starts with a period. If you are posting a message, and the line begins with a period, you must insert an extra period at the beginning of the line. A line with a single period is used to indicate the end of a message.
You might want to check out my web site for Power-Post at www.cosmicwolf.com. I don''t have a lot of time to update the program, so I will probably be posting the complete source code there.
Cheers!
// CHRIS
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement