Thread View: news.software.nntp
30 messages
30 total messages
Started by Florian Zschocke
Fri, 06 Aug 2004 09:10
POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Fri, 06 Aug 2004 09:10
Date: Fri, 06 Aug 2004 09:10
17 lines
1759 bytes
1759 bytes
Hello NG, sometimes if I post a new message I don't get a 240.... response from the server. If I write the post command on the socket, the server replies with "340 desired <message id>". I send the message to the server - but sometimes there is no response. Is that "normal" when the server is perhaps too busy ? Or is that a error in my socket communication(it works fine in all other cases)? Perhaps I have to wait for the answer ? What can I do if I want to have a queue for outgoing messages and want to prevent that a message is send twice. Could I use the delivered message-id and ask the server if he has that message ? Thank you for your time and help Florian
Re: POST -> no response, but message is posted.
Author: Juergen Helbing
Date: Sun, 08 Aug 2004 06:49
Date: Sun, 08 Aug 2004 06:49
38 lines
2406 bytes
2406 bytes
Florian Zschocke <edv@zschocke-berlin.de> wrote: >sometimes if I post a new message I don't get a 240.... response from the server. If I >write the post command on the socket, the server replies with "340 desired <message >id>". I send the message to the server - but sometimes there is no response. Is that >"normal" when the server is perhaps too busy ? Or is that a error in my socket >communication(it works fine in all other cases)? Perhaps I have to wait for the >answer ? Perhaps you are switching your sockets between sync and async operation. Then it might happen that data is lost in your programming logic. Beside this I've never seen a major host (or server software) which has problems to send the 340 response. The only thing which happens _often_ is that the 340 response comes very delayed (up to 30-60 seconds). Busy posting servers need a long time for the POST to be finished. In this case you might not wait long enough for the reply and time out. >What can I do if I want to have a queue for outgoing messages and want to prevent that a >message is send twice. Could I use the delivered message-id and ask the server if he >has that message ? >Thank you for your time and help >Florian I am having the best experience with creating own message-ids and doing a STAT <msgid> command before I post a message. This is very similar to a 'simulated IHAVE' and works on nearly all hosts because newarly all of the host are accepting preloaded Message-ID headers nowadays. HTH -- Juergen -------------------------- MyNews for Windows: www.winews.net
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Sun, 08 Aug 2004 10:32
Date: Sun, 08 Aug 2004 10:32
34 lines
2523 bytes
2523 bytes
archiver+nsn@i3w.com (Juergen Helbing) wrote: > > Thank you Jรผrgen > >Perhaps you are switching your sockets between sync and async operation. >Then it might happen that data is lost in your programming logic. > No, it is the same recv i use for the other communication too. >Beside this I've never seen a major host (or server software) which >has problems to send the 340 response. >The only thing which happens _often_ is that the 340 response comes >very delayed (up to 30-60 seconds). Busy posting servers need a long >time for the POST to be finished. >In this case you might not wait long enough for the reply and time out. > I always get a 340 but the confirming 240 is missing sometimes. > > >I am having the best experience with creating own message-ids and >doing a STAT <msgid> command before I post a message. This is >very similar to a 'simulated IHAVE' and works on nearly all hosts >because newarly all of the host are accepting preloaded Message-ID >headers nowadays. > Ok, perhaps I will try that too. Would it be "legal" to say - I don't worry about the 240 confirmation, I take the delivered message-id put it into my message, put the message into the queue (unsure if it was send or not) and ask the server with IHAVE if he wants it. Sure, this means more traffic for the server. Florian
Re: POST -> no response, but message is posted.
Author: Andrew - Supernews
Date: Sun, 08 Aug 2004 10:48
Date: Sun, 08 Aug 2004 10:48
25 lines
1933 bytes
1933 bytes
On 2004-08-06, Florian Zschocke <edv@zschocke-berlin.de> wrote: > Hello NG, > > sometimes if I post a new message I don't get a 240.... response from the > server. How long do you wait for it? Failing to get a 240 response _at all_ usually means either that the server is broken, or that your article terminator is defective (are you correctly using CR+LF as line terminator? Are you ensuring there is no garbage such as NUL characters in your article? Have you monitored the data being sent in such cases to ensure it's correct?) If the server is busy the 240 response might be slow, or very slow; your timeout for it needs to be several minutes at least. > What can I do if I want to have a queue for outgoing messages and want to > prevent that a message is send twice. Just make sure you use the same message-id both times, that's enough. -- Andrew, Supernews http://www.supernews.com - individual and corporate NNTP services
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Sun, 08 Aug 2004 11:32
Date: Sun, 08 Aug 2004 11:32
44 lines
2875 bytes
2875 bytes
Andrew - Supernews <andrew+nonews@supernews.com> wrote: > > Thank you Andrew > >How long do you wait for it? > Not at all at the moment. I send the data and if that is done I read from the socket. So this is heavy to debug - cause the failure will not raise if I debug. That leads me to the conclusion that it is time dependent. So what can I do ? A generic wait will not help. I could loop until select() gives a positive value but that will be too expensive ? >Failing to get a 240 response _at all_ usually means either that the server >is broken, or that your article terminator is defective (are you correctly >using CR+LF as line terminator? Are you ensuring there is no garbage such >as NUL characters in your article? Have you monitored the data being sent >in such cases to ensure it's correct?) > No, I don't think there is a error in the message, cause it is posted by the server and as far as I can see it is conform to rfc 850 and terminated with \r\n.\r\n. >If the server is busy the 240 response might be slow, or very slow; your >timeout for it needs to be several minutes at least. > >> What can I do if I want to have a queue for outgoing messages and want to >> prevent that a message is send twice. > >Just make sure you use the same message-id both times, that's enough. > For the application it would be better not to wait. If you say, wait two seconds to get all the responses,I would say ok lets pause the thread for that time. If I don't wait ? My server gives me a a desired message-id with the 340 response. Can I use this ID or is that a uncommon feature and it is better to generate the id myself ? Thank you Florian
Re: POST -> no response, but message is posted.
Author: Andrew - Supernews
Date: Sun, 08 Aug 2004 12:52
Date: Sun, 08 Aug 2004 12:52
51 lines
3272 bytes
3272 bytes
On 2004-08-08, Florian Zschocke <edv@zschocke-berlin.de> wrote: > Andrew - Supernews <andrew+nonews@supernews.com> wrote: >>How long do you wait for it? >> > Not at all at the moment. I send the data and if that is done I read > from the socket. That's no good at all. How are you dealing with other command-response sequences? > So what can I do ? A generic wait will not help. I could loop until > select() gives a positive value but that will be too expensive ? select() with a suitable timeout? It sounds to me as though you have written your application in complete ignorance of basic programming principles. You can not possibly assume that all server responses will be immediately available as soon as you look for them; you will _always_ have to allow for the possibility that you have to wait for the server. Posting is no different from any other commands in this respect (unless of course you are a spammer). How you go about waiting depends entirely on the programming model you are using for your application - you might choose to block the thread, or to use an event-driven state model, or any of a number of other variations. >>Just make sure you use the same message-id both times, that's enough. >> > For the application it would be better not to wait. If you say, wait > two seconds to get all the responses,I would say ok lets pause the > thread for that time. If I don't wait ? The fact that you are even asking this question shows that you do not understand what you are trying to do. You do not and can not know whether your POST succeeded until you get the server's response. Furthermore, pipelining POST commands is forbidden, which means that you MUST NOT send any more commands to the server until you get the server's response back after sending the article. > My server gives me a a desired message-id with the 340 response. Can I > use this ID or is that a uncommon feature and it is better to generate > the id myself ? The "recommended ID" feature isn't universal; you can't rely on it at all. (Our server doesn't support it, for example, since it has no way of knowing which domain to use for the RHS). -- Andrew, Supernews http://www.supernews.com - individual and corporate NNTP services
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Sun, 08 Aug 2004 13:56
Date: Sun, 08 Aug 2004 13:56
59 lines
3629 bytes
3629 bytes
Andrew - Supernews <andrew+nonews@supernews.com> wrote: > > On 2004-08-08, Florian Zschocke <edv@zschocke-berlin.de> wrote: >> Andrew - Supernews <andrew+nonews@supernews.com> wrote: >>>How long do you wait for it? >>> >> Not at all at the moment. I send the data and if that is done I read >> from the socket. > >That's no good at all. How are you dealing with other command-response >sequences? > >> So what can I do ? A generic wait will not help. I could loop until >> select() gives a positive value but that will be too expensive ? > >select() with a suitable timeout? > >It sounds to me as though you have written your application in complete >ignorance of basic programming principles. You can not possibly assume that >all server responses will be immediately available as soon as you look for >them; you will _always_ have to allow for the possibility that you have to >wait for the server. Posting is no different from any other commands in this >respect (unless of course you are a spammer). Yes, and no - I'm no spammer. But it the first time I got into contact with socket programming and I'm everything else than familiar with that. >How you go about waiting depends entirely on the programming model you are >using for your application - you might choose to block the thread, or to >use an event-driven state model, or any of a number of other variations. > > >The fact that you are even asking this question shows that you do not >understand what you are trying to do. > Not in detail, there are some questions still left. For me is clear that on a client- server model that there has to be a time independent protocol. In all other cases the command - response communication works fine. I took the principe of the socket programming out the examples I found on the net. But I see now I have to read that stuff again. >You do not and can not know whether your POST succeeded until you get the >server's response. Furthermore, pipelining POST commands is forbidden, >which means that you MUST NOT send any more commands to the server until >you get the server's response back after sending the article. > Ok - I thought that it has to be that way. > >The "recommended ID" feature isn't universal; you can't rely on it at all. >(Our server doesn't support it, for example, since it has no way of >knowing which domain to use for the RHS). > Ok, that is also a important information for me. Thank you
Re: POST -> no response, but message is posted.
Author: Robert Nichols
Date: Sun, 08 Aug 2004 14:53
Date: Sun, 08 Aug 2004 14:53
17 lines
2031 bytes
2031 bytes
In article <40498.88420s@liebchen.winews.net>, Juergen Helbing <archiver+nsn@i3w.com> wrote: : :I am having the best experience with creating own message-ids and :doing a STAT <msgid> command before I post a message. This is :very similar to a 'simulated IHAVE' and works on nearly all hosts :because newarly all of the host are accepting preloaded Message-ID :headers nowadays. The big advantage of generating your own Message-ID (or using the one suggested by the server on your *first* POST attempt) is that re-sending an already accepted article is harmless. You are assured that only one copy of the article will be accepted and all subsequent copies will be rejected as duplicates. -- Bob Nichols AT comcast.net I am "rnichols42"
Re: POST -> no response, but message is posted.
Author: Curt Welch
Date: Sun, 08 Aug 2004 16:31
Date: Sun, 08 Aug 2004 16:31
10 lines
1608 bytes
1608 bytes
andrew@supernews.com wrote: > The "recommended ID" feature isn't universal; you can't rely on it at > all. (Our server doesn't support it, for example, since it has no way of > knowing which domain to use for the RHS). What's wrong with using supernews.com as the RHS for the recommended ID? -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: POST -> no response, but message is posted.
Author: Curt Welch
Date: Sun, 08 Aug 2004 16:58
Date: Sun, 08 Aug 2004 16:58
43 lines
3261 bytes
3261 bytes
Florian Zschocke <edv@zschocke-berlin.de> wrote: > Andrew - Supernews <andrew+nonews@supernews.com> wrote: > > > > > Thank you Andrew > > > >How long do you wait for it? > > > Not at all at the moment. I send the data and if that is done I read > from the socket. So this is heavy to debug - cause the failure will not > raise if I debug. That leads me to the conclusion that it is time > dependent. > So what can I do ? A generic wait will not help. I could loop until > select() gives a positive value but that will be too expensive ? As Andrew has said, it sounds like you are a bit out of your league here (i.e., still have a lot to learn). A normal socket read will hang (block the thread/processes) until the data is there. So all you have to do is read. Just don't make the mistake of assuming the entire response will always show up in a single read. You have to buffer the returned data and wait until you have the full response, ending with CR LF. So you must loop reading data until the full response shows up. The simple way to do this is to use character based IO (fgetc()). You loop reading characters into a buffer until you get the CR LF ending the line. And then you processes the response. That works fine for reading a response line, but may not be fast enough for high speed downloading of headers and articles if you are trying to write a general newsreader. If you are using ASYNC IO by setting a NONBLOCK option, then you are into a more complex programming problem. It's unlcear from your response above if you have done that, or if you have not, and are just confused by what your code is doing. If you are using ASYNC IO, then you need to use a select() with (or without) a timeout value to wait for data to show up (or to wait forever). But you still need to loop doing the select, and reading data, until the full command has shown up, because like above, you can't assume the full response will show up in a single read. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: POST -> no response, but message is posted.
Author: Andrew - Supernews
Date: Sun, 08 Aug 2004 17:23
Date: Sun, 08 Aug 2004 17:23
15 lines
1901 bytes
1901 bytes
On 2004-08-08, Curt Welch <curt@kcwc.com> wrote: > andrew@supernews.com wrote: >> The "recommended ID" feature isn't universal; you can't rely on it at >> all. (Our server doesn't support it, for example, since it has no way of >> knowing which domain to use for the RHS). > > What's wrong with using supernews.com as the RHS for the recommended ID? Because some of the domains we serve don't use that, and the reader-facing code knows nothing at all about the posting process, it just tunnels the POSTed articles through to a specialised posting server. -- Andrew, Supernews http://www.supernews.com - individual and corporate NNTP services
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Sun, 08 Aug 2004 18:10
Date: Sun, 08 Aug 2004 18:10
20 lines
1948 bytes
1948 bytes
Andrew - Supernews <andrew+nonews@supernews.com> wrote: > > >> >> What's wrong with using supernews.com as the RHS for the recommended ID? > >Because some of the domains we serve don't use that, and the reader-facing >code knows nothing at all about the posting process, it just tunnels the >POSTed articles through to a specialised posting server. > I generate my own message-id now. The socket works fine now. I did not know that I had to wait until the fd is ready. I have used this nntp-class now for month without trouble, or even thinking about that there could be something wrong -> the newsserver of my provider seems to be fast. Now the thread sleeps 500 msec between the cycle until the response is there. Is 500 msec a probate value ? Thank you again.
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Sun, 08 Aug 2004 18:40
Date: Sun, 08 Aug 2004 18:40
18 lines
1895 bytes
1895 bytes
curt@kcwc.com (Curt Welch) wrote: > Thank you Curt > >If you are using ASYNC IO by setting a NONBLOCK option, then you are into a >more complex programming problem. It's unlcear from your response above if >you have done that, or if you have not, and are just confused by what your >code is doing. If you are using ASYNC IO, then you need to use a select() >with (or without) a timeout value to wait for data to show up (or to wait >forever). But you still need to loop doing the select, and reading data, >until the full command has shown up, because like above, you can't assume >the full response will show up in a single read. > I think, that is my main problem, that I still don't understand what is the difference between blocking an nonblocking. Florian
Re: POST -> no response, but message is posted.
Author: Curt Welch
Date: Mon, 09 Aug 2004 02:04
Date: Mon, 09 Aug 2004 02:04
27 lines
2274 bytes
2274 bytes
Florian Zschocke <edv@zschocke-berlin.de> wrote: > Andrew - Supernews <andrew+nonews@supernews.com> wrote: > > > > > >> > >> What's wrong with using supernews.com as the RHS for the recommended > >> ID? > > > >Because some of the domains we serve don't use that, and the > >reader-facing code knows nothing at all about the posting process, it > >just tunnels the POSTed articles through to a specialised posting > >server. > > > I generate my own message-id now. > The socket works fine now. I did not know that I had to wait until the > fd is ready. I have used this nntp-class now for month without trouble, > or even thinking about that there could be something wrong -> the > newsserver of my provider seems to be fast. Now the thread sleeps 500 > msec between the cycle until the response is there. Is 500 msec a > probate value ? That can work. But it's odd to have to code it that way. It all depends on the the environment you are writing this code for. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: POST -> no response, but message is posted.
Author: Curt Welch
Date: Mon, 09 Aug 2004 02:42
Date: Mon, 09 Aug 2004 02:42
107 lines
6692 bytes
6692 bytes
Florian Zschocke <edv@zschocke-berlin.de> wrote: > curt@kcwc.com (Curt Welch) wrote: > > > Thank you Curt > > > >If you are using ASYNC IO by setting a NONBLOCK option, then you are > >into a more complex programming problem. It's unlcear from your > >response above if you have done that, or if you have not, and are just > >confused by what your code is doing. If you are using ASYNC IO, then > >you need to use a select() with (or without) a timeout value to wait for > >data to show up (or to wait forever). But you still need to loop doing > >the select, and reading data, until the full command has shown up, > >because like above, you can't assume the full response will show up in a > >single read. > > I think, that is my main problem, that I still don't understand what is > the difference between blocking an nonblocking. Blocking is the normal way for both computers and programing langauges to work. When you write a program as a list of instructions, the computer performs the instructions in sequence. It will not perform the second instruction until the first has finished. It will not perform the third instruction until the second has finished. So, when you write something like: A <- 1 A <- 2 B <- A You know that the value of B will be 2 after these instructions finish, because the third instruction which copies the value of A, to B, will not happen until after the second instruction, where the value of 2 is assigned to A. This is norm "blocking" behavior so it's nothing unusal for any programing language. But it's also what you expect the computer hardware to do, so it's odd trying to think of anything else. However, if you do something like read data from a disk, it takes a lot of time, and runs parallel to the processing of the computer. The computer sends a command to the disk controller telling it to read block N from the disk and put the data it gets into memory at some location. When the disk controler is done reading the data, it signals the computer with an interrupt. If you want, you can write the computer disk driver code so that's it's blocking. By that, I mean that once it sends the command to the disk to read the data, it hangs in a busy loop constantly checking the status to see if the read is done. If it does that, the computer of course can not do anything else while it's waiting for the disk IO to finish. So, all modern OSs will allow the computer to be working on many different tasks at the same time. Each processes can do a disk read, but will block for that processes. That means the OS sends the command to the disk to start the IO, but then goes to work on any other processes which is not blocked, waiting for some external task to finish. So in a typical programing langauge, when you use code to read data from the disk, just like all statements in the langauge, the program will not continue with the next statement until the read is done. It blocks, even though the CPU can still be used to run other tasks. Many programming langages however offer special nonblocking versions of fuctions like disk IO, and network IO. So, for disk IO, the program can make a request to read a block from disk, but not block, and continue processing - but the programer of course has to deal with the fact that the data requested will show up at some time in the future. For reading from a network, you can never "request" the network sends data to you, you simply have to check to see if data has been sent, and respond to it correctly. A typical blocking read for network data will hang until some network data shows up. A non-blocking read will return data if it's there, otherwise, it will return an indication that no data was available. It sounds like the language/Class you are using implements non-blocking reads. Protocols like NNTP do not require the more complex non-blocking reads. However, if you want a program which is dealing with multiple connections at the same time, you need non-blocking reads so that the program can work on a response from one connection, while waiting for the next response on the second connection. If your program is not trying to do anything else while it's waiting for the response from the server, then you should use a blocking read, instead of using a non-blocking read, and sleeping for 500 ms between checks for data. It's poor technique to force your program to delay for 500 ms if the server you are using responds in 5 ms. If the routines you are using do not support a blocking read, but you do have the ability to do a select(), then you should do that. Use select to wait for the data, and then read the data once the select() says it's there. The select is a blocking call which will cause the program to puase until the data shows up, but allow it to continue when it shows up, so there will be no extra delays in your code. And if you want, you can use the timeout feature of select to limit how long the program will wait before it gives up on the server and reports an error to the user. But, on another note, if you are working in some GUI environmet, where the GUI stops responding when you block, then select() is not what you want to do. You need something more complex. But that answer to how that needs to be done is a function of what environment you are trying to program for. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: POST -> no response, but message is posted.
Author: Russ Allbery
Date: Mon, 09 Aug 2004 05:33
Date: Mon, 09 Aug 2004 05:33
47 lines
3856 bytes
3856 bytes
Curt Welch <curt@kcwc.com> writes:
> Many programming langages however offer special nonblocking versions of
> fuctions like disk IO, and network IO. So, for disk IO, the program can
> make a request to read a block from disk, but not block, and continue
> processing - but the programer of course has to deal with the fact that
> the data requested will show up at some time in the future.
Strictly speaking, that's asynchronous I/O, which is yet another thing.
By default, I/O is blocking and synchronous. Non-blocking I/O is still
synchronous by default; when you read from your file or network
connection, you will either get the data back immediately or you'll get an
indication that there was no data. The only difference between blocking
and non-blocking is that in the non-blocking case, you'll get an error
when there isn't any data instead of just waiting until there is some.
(As Curt does go on to explain.)
Asynchronous I/O is yet another mode of operation, where you request a
read, that read returns success, and at some point later on the data
magically shows up in the relevant memory buffer. That involves a
different type of programming that's closer to what you have to do with
threads, where multiple things are happening in your program at the same
time, although it's not quite as complicated. You have to be careful
about things like not using the buffer until the data magically shows up,
though, that you don't have to worry about with non-blocking I/O.
I mention this just because there was at least one transit news server
written to use asynchronous I/O using the aio_read() family of functions
available on various platforms.
> If the routines you are using do not support a blocking read, but you do
> have the ability to do a select(), then you should do that. Use select
> to wait for the data, and then read the data once the select() says it's
> there. The select is a blocking call which will cause the program to
> puase until the data shows up, but allow it to continue when it shows
> up, so there will be no extra delays in your code.
Nearly all programs using non-blocking I/O should be using select() or
poll(). It's generally a sign that something isn't right if a program
uses non-blocking I/O but never calls either select() or poll(), or some
framework function that ends up calling them undert he hood.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Mon, 09 Aug 2004 07:08
Date: Mon, 09 Aug 2004 07:08
37 lines
2918 bytes
2918 bytes
curt@kcwc.com (Curt Welch) wrote: > Thank you Curt for that detailed answer > >Protocols like NNTP do not require the more complex non-blocking reads. >However, if you want a program which is dealing with multiple connections >at the same time, you need non-blocking reads so that the program can work >on a response from one connection, while waiting for the next response on >the second connection. So what i have now is, that I am sure that I use *blocking* cause non-bolcking is never set with fnctl(). Do I understand this right, that even if I use non-blocking sockets, I will still not be able to have a asynchronous or parallel download of information on one socket? >If your program is not trying to do anything else while it's waiting for >the response from the server, then you should use a blocking read, instead >of using a non-blocking read, and sleeping for 500 ms between checks for >data. It's poor technique to force your program to delay for 500 ms if the > Like you mentioned before, that was a mistake and did not change anything in the behavior of my program. My mistake was that I left some characters on the socket. I don't use select anymore. To speed up things I have detached the time consuming download from the socket as thread. In my GUI if you download a message with a binary and step to the next message before the binary is there, the program will make up a new socket. In praxis that dose not happen often. But perhaps I have to set a limit of sockets to protect the server. Is that a bad style, to have more than one socket ? Could I do the same thing I do now with multiple blocking sockets with one non-blocking socket ? Thank you for your time and help
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Mon, 09 Aug 2004 08:05
Date: Mon, 09 Aug 2004 08:05
34 lines
2710 bytes
2710 bytes
curt@kcwc.com (Curt Welch) wrote: > Thank you for your detailed answer > >Protocols like NNTP do not require the more complex non-blocking reads. >However, if you want a program which is dealing with multiple connections >at the same time, you need non-blocking reads so that the program can work >on a response from one connection, while waiting for the next response on >the second connection. > Now I'm sure that I use a *blocking* socket, cause non-blocking is never set with fnctl(). >If your program is not trying to do anything else while it's waiting for >the response from the server, then you should use a blocking read, instead >of using a non-blocking read, and sleeping for 500 ms between checks for >data. It's poor technique to force your program to delay for 500 ms if the >server you are using responds in 5 ms. > Like you mentioned before that this did not change anything in the behavior of my program. I don't use select() anymore. What I do now, to speed up things and get the GUI more independent I detach the time consuming download from the server as thread. If you download a binary and step to the next message while the socket is busy, I make up a new socket, so that the user don't has to wait. In praxis that won't happen often but perhaps I have to limit the number sockets to protect the server. Is that bad style ? Could I do the same I do now with multiple bocking sockets with one non-blocking socket ? Thank you for your time and help Florian
Re: POST -> no response, but message is posted.
Author: Curt Welch
Date: Tue, 10 Aug 2004 14:14
Date: Tue, 10 Aug 2004 14:14
111 lines
7022 bytes
7022 bytes
Florian Zschocke <edv@zschocke-berlin.de> wrote: > curt@kcwc.com (Curt Welch) wrote: > > > Thank you Curt for that detailed answer > > > >Protocols like NNTP do not require the more complex non-blocking reads. > >However, if you want a program which is dealing with multiple > >connections at the same time, you need non-blocking reads so that the > >program can work on a response from one connection, while waiting for > >the next response on the second connection. > > So what i have now is, that I am sure that I use *blocking* cause > non-bolcking is never set with fnctl(). > Do I understand this right, that even if I use non-blocking sockets, I > will still not be able to have a asynchronous or parallel download of > information on one socket? A TCP connection (i.e. a single socket) is a single serial data stream between your program, and the news server. The NNTP protocol is a simple command response protocol. When you ask for an article, it sends that article, and you can't do anything else with the connection until the article is completely sent. There's no way with NNTP to do two things at the same time, like download two articles at the same time. You can pipeline most (but not all) NNTP commands, but that gets very tricky with blocking sockets because your program can deadlock. That is, you can send two ARTICLE commands before reading the response to the first command. If you write too much before reading however, the system will flow control all the way back to you and block you as you are writing, and your program will just lock up. > >If your program is not trying to do anything else while it's waiting for > >the response from the server, then you should use a blocking read, > >instead of using a non-blocking read, and sleeping for 500 ms between > >checks for data. It's poor technique to force your program to delay for > >500 ms if the > > > Like you mentioned before, that was a mistake and did not change > anything in the behavior of my program. My mistake was that I left some > characters on the socket. Yeah, it's easy to make that mistake and then get very confused about what your program is doing when those extra characters seem to just "show up" at the wrong time later. Network programing can be very confusing. > I don't use select anymore. To speed up > things I have detached the time consuming download from the socket as > thread. In my GUI if you download a message with a binary and step to > the next message before the binary is there, the program will make up a > new socket. In praxis that dose not happen often. But perhaps I have to > set a limit of sockets to protect the server. Yes, you have to set limits. Many servers will limit how many connections you can use (some have limits as small as 1 or 2), so not only do you need to limit it to something reasonable to protect the server, you also have to deal with the fact that some servers won't let you make multiple connetions or will only let you make a small number of connections. > Is that a bad style, to have more than one socket ? No, it's fine. Many programs use multiple sockets to the same server. You just have to be careful about how it works, and you should try to do whatever you can to minimize the number of sockets. Larger servers also use complex distributed systems that can, at times, either by accident, or design, get out of sync with one another. So another thing to watch out for is the fact that two connections to the same server, may in fact be connections to different servers which are very similar, but not identical. The time new articles show up for example might be slightly different, so the high-water mark for a group may be different. One connection may say the high water mark for a group is 100, and the other server is still at 98. If you trust the high water mark returned from a GROUP command on one connction, and then try to fetch article 100 from a second connection, you risk (small risk), that the article won't be there because the two connections are slightly out of sync. The amount of stuff like this that you would expect to work, but doesn't always work, is large. So, the tricker you get with multiple connections, the more likely you will run into these unexpected conditions. So the more you can do with a single connection, the better. > Could I do the same > thing I do now with multiple blocking sockets with one non-blocking > socket ? There is no way to abort a command with NNTP other than closing the socket. So if you want to allow the user to abort a download (like transfering a large binary article that the user thought was just a small text message), instead of forcing them to wait, you have to close the socket and open a new one. If you want the first one to finsih in the background, while a new connection downloads the next article, that's fine, and you have to use two connections to do that. The one thing I hate about many newsreaders is that they try to isolate the user from these complexities of how NNTP works. They think they can design a GUI with no regard to the fact that it's a front-end for an NNTP server. They think it's ok for all the NNTP "stuff" to happen magically in the background as if it's not important to the user. But then something happens, like connections hang on authentication for 30 seconds, and all the user sees is that the GUI stops responding for an unknown reason at an unknown time. A good NNTP newsreader will not try to hide the nature, and problems, of NNTP from the user. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com http://NewsReader.Com/
Re: POST -> no response, but message is posted.
Author: Curt Welch
Date: Tue, 10 Aug 2004 14:16
Date: Tue, 10 Aug 2004 14:16
14 lines
1610 bytes
1610 bytes
Florian Zschocke <edv@zschocke-berlin.de> wrote: > curt@kcwc.com (Curt Welch) wrote: > sockets with one non-blocking socket ? You inserted an extra CR after that ? I don't know if it's your newsreader letting you do that, but if it is, you should fix that. I think it's the second time I've seen an extra CR in your messages. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com http://NewsReader.Com/
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Tue, 10 Aug 2004 16:42
Date: Tue, 10 Aug 2004 16:42
41 lines
3181 bytes
3181 bytes
curt@kcwc.com (Curt Welch) wrote: > > >The one thing I hate about many newsreaders is that they try to isolate the >user from these complexities of how NNTP works. They think they can design >a GUI with no regard to the fact that it's a front-end for an NNTP server. >They think it's ok for all the NNTP "stuff" to happen magically in the >background as if it's not important to the user. But then something >happens, like connections hang on authentication for 30 seconds, and all >the user sees is that the GUI stops responding for an unknown reason at an >unknown time. > >A good NNTP newsreader will not try to hide the nature, and problems, of >NNTP from the user. > Hm, I'm writing a mac program. I think the typical mac user would expect not to get involved with the nntp "stuff". What would you expect from a good newsreader. Do you think about something like a nntp command console ? I often thought about that. But I don't know if anybody will use that. Perhaps it would be nice if you can define your own queries and save them in macros. On the other hand I can not see the use of asking the user how he wants to encode his message. Most people don't know the difference between uu and base64 and have never red any rfc about mime. I try to log things so that you always can see for example the last server response. But when the server do not response for some reason the next that will happen is that your read from the socket will get <0. My program will try to reconnect and repost the last command. If there is still no response the program will raise a alert that the connection is confused or broken. But Curt, it is my first program and i am open for everything. Do you have a mac with osx for use ? One thing I could really need now, is a server which has limit of sockets per client to test again. With the servers I have tested I could not find this limitation. Thank you again that you spend so much time for answering my question. Florian
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Tue, 10 Aug 2004 17:06
Date: Tue, 10 Aug 2004 17:06
20 lines
1553 bytes
1553 bytes
curt@kcwc.com (Curt Welch) wrote: > > Florian Zschocke <edv@zschocke-berlin.de> wrote: >> curt@kcwc.com (Curt Welch) wrote: > >> sockets with one non-blocking socket ? > >You inserted an extra CR after that ? > >I don't know if it's your newsreader letting you do that, but if it is, you >should fix that. I think it's the second time I've seen an extra CR in >your messages. > Thank you for your advice. I did some first tests but I could not find the reason jet. Florian
Re: POST -> no response, but message is posted.
Author: iMeowbot
Date: Tue, 10 Aug 2004 23:12
Date: Tue, 10 Aug 2004 23:12
53 lines
3565 bytes
3565 bytes
In article <555639F2-EAEC-11D8-9D51-000393453BC2-613-0000002A99BCC492%edv@zschocke- berlin.de>, Florian Zschocke <edv@zschocke-berlin.de> wrote: > Hm, I'm writing a mac program. I think the typical mac user There is no such animal, and I don't simply mean that Mac users tend to be weirdos =) OS X has drastically changed the user base. > would expect not to get involved with the nntp "stuff". What would > you expect from a good newsreader. At the very least you want the ability to log everything. Users who know what's going on will appreciate it, and even novices can make use it when dealing with their ISP tech support people. > Do you think about something like a nntp command console ? I often > thought about that. Meh, that's just telnet. You want nice basic features that often get left out? Offer a little dialog that lets you enter a message ID into a field, choose from the known servers, and fetch that article. If you make Messages IDs and email addresses clickable, give the end user the choice of which one it is (heuristics will never get it 100% right). Use up-to-date language services. There's nothing quite as annoying as having an application refuse to allow a character to be typed when it can display it just fine. > Perhaps it would be nice if you can define your own queries and save > them in macros. Look at Mail.app's simple but wicked useful search, or iTunes' smart playlists, or Tiger's new searches if you have that available. No more specialized little language thingies to remember, please? :( > On the other hand I can not see the use of asking the user how he wants > to encode his message. Most people don't know the difference between uu > and base64 and have never red any rfc about mime. It does still matter, some groups have users that insist on a particular encoding. What happens is that popular reading/leeching programs will have problems with one encoding, so people end up avoiding it. The encoding non grata changes over time. -- "I loathe people who keep dogs. They are cowards who haven't got the guts to bite people themselves." - August Strindberg
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Wed, 11 Aug 2004 07:34
Date: Wed, 11 Aug 2004 07:34
60 lines
3339 bytes
3339 bytes
iMeowbot@mac.com wrote: > > > >At the very least you want the ability to log everything. Users who >know what's going on will appreciate it, and even novices can make use >it when dealing with their ISP tech support people. > >> Do you think about something like a nntp command console ? I often >> thought about that. > >Meh, that's just telnet. > >You want nice basic features that often get left out? Offer a little >dialog that lets you enter a message ID into a field, choose from the >known servers, and fetch that article. > Ok, that would be easy. But you can also use google for that. >If you make Messages IDs and email addresses clickable, give the end >user the choice of which one it is (heuristics will never get it 100% >right). > I think I have done what you mean, unless the used email-addresses are normally useless these days. >Use up-to-date language services. There's nothing quite as annoying as >having an application refuse to allow a character to be typed when it >can display it just fine. > The program is full mime compliant and will support every encoding which is provided by the apple foundation framework. > >Look at Mail.app's simple but wicked useful search, or iTunes' smart >playlists, or Tiger's new searches if you have that available. No more >specialized little language thingies to remember, please? :( > I think, I have implemented a real useful simple text search. At the end of beta or in the second release I will have a more complex search with several options. > >It does still matter, some groups have users that insist on a particular >encoding. What happens is that popular reading/leeching programs will >have problems with one encoding, so people end up avoiding it. The >encoding non grata changes over time. > I will only support uudecoding cause it is *not* part of mime. If you send a multipart/mixed message it will be a mime-message. It would be fine, if you could help me in testing and making my program better. I think there will be the first official beta in one or two month. I will post that here and in several mac groups. Thank you Florian
Re: POST -> no response, but message is posted.
Author: iMeowbot
Date: Wed, 11 Aug 2004 08:02
Date: Wed, 11 Aug 2004 08:02
26 lines
2358 bytes
2358 bytes
In article <E5E84C0E-EB68-11D8-9952-000393453BC2-760-0000005810485E70%edv@zschocke- berlin.de>, Florian Zschocke <edv@zschocke-berlin.de> wrote: > >You want nice basic features that often get left out? Offer a little > >dialog that lets you enter a message ID into a field, choose from the > >known servers, and fetch that article. > > > Ok, that would be easy. But you can also use google for that. With Google, the ability to save a local copy in the same format as other articles, following up or mailing replies with a decent editor, and so on, are lost. And of course, X-No-Archive articles are missing. > It would be fine, if you could help me in testing and making my program > better. I think there will be the first official beta in one or two > month. > I will post that here and in several mac groups. > Thank you Sounds good, thanks. -- "I loathe people who keep dogs. They are cowards who haven't got the guts to bite people themselves." - August Strindberg
Re: POST -> no response, but message is posted.
Author: Frank Slootweg
Date: Wed, 11 Aug 2004 12:17
Date: Wed, 11 Aug 2004 12:17
22 lines
2167 bytes
2167 bytes
iMeowbot@mac.com wrote: > In article > <E5E84C0E-EB68-11D8-9952-000393453BC2-760-0000005810485E70%edv@zschocke- > berlin.de>, > Florian Zschocke <edv@zschocke-berlin.de> wrote: > > > >You want nice basic features that often get left out? Offer a little > > >dialog that lets you enter a message ID into a field, choose from the > > >known servers, and fetch that article. > > > > > Ok, that would be easy. But you can also use google for that. > > With Google, the ability to save a local copy in the same format as > other articles, following up or mailing replies with a decent editor, > and so on, are lost. And of course, X-No-Archive articles are missing. And any articles from groups which are not archived by Google (Groups), i.e. all 'local' (server/site/company/ISP/etc. specific) groups. Bottom line: Google Groups is not Usenet, nor a news server, let alone a bunch of news servers. [deleted]
Re: POST -> no response, but message is posted.
Author: Curt Welch
Date: Wed, 11 Aug 2004 20:15
Date: Wed, 11 Aug 2004 20:15
12 lines
1593 bytes
1593 bytes
Florian Zschocke <edv@zschocke-berlin.de> wrote: > But Curt, it is my first program and i am open for everything. Do you > have a mac with osx for use ? Nope. The only Mac I have is an orginal Mac which was later updated to a Mac 512. I still have the old mother board from the Original Mac before the upgrade. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com http://NewsReader.Com/
Re: POST -> no response, but message is posted.
Author: Florian Zschocke
Date: Wed, 11 Aug 2004 20:49
Date: Wed, 11 Aug 2004 20:49
12 lines
1310 bytes
1310 bytes
curt@kcwc.com (Curt Welch) wrote: > > > >Nope. The only Mac I have is an orginal Mac which was later updated to a >Mac 512. I still have the old mother board from the Original Mac before >the upgrade. > With OSX they got nice again ! Florian
Re: POST -> no response, but message is posted.
Author: Curt Welch
Date: Wed, 11 Aug 2004 22:04
Date: Wed, 11 Aug 2004 22:04
25 lines
2185 bytes
2185 bytes
Florian Zschocke <edv@zschocke-berlin.de> wrote: > curt@kcwc.com (Curt Welch) wrote: > >Nope. The only Mac I have is an orginal Mac which was later updated to > >a Mac 512. I still have the old mother board from the Original Mac > >before the upgrade. > > With OSX they got nice again ! Yeah, I've played with the new Macs multiple times over at the local Apple store. I'd like to get one but just haven't been able to justify the time or money yet. I own a NeXT which is kinda the grandfather of the new OSX macs and loved what they were able to do with the combination of a real OS under the hood and a good GUI on top. It was nice to see that Apple was able to continue on with that line of work because they never had enough time to get all the work done that needed to be done when still at NeXT. I was a registered developer for both the original Macs and for the NeXT hardware. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com http://NewsReader.Com/
Max OS X applications (was POST -> no response, but message is posted)
Author: John de Hoog
Date: Wed, 11 Aug 2004 22:58
Date: Wed, 11 Aug 2004 22:58
28 lines
2513 bytes
2513 bytes
Florian Zschocke wrote... > With OSX they got nice again ! I agree in part. The OS is pretty nice, which prompted me to buy a PowerBook recently. But I'm a bit disappointed with the choice of applications. Take (Usenet) news readers. While there are some interesting programs such as Hogwasher and Unison, as well as some old standby programs from the past, and Thoth (which is no longer officially available), I haven't found a winner among them (nothing like News Rover, for example). As for RSS readers, Shrook is nice, but none of the available readers can touch FeedDemon. For one thing, there isn't a single RSS reader capable of displaying the whole article in the review pane. Email programs are also deficient. Entourage isn't bad, and PowerMail has its advantages, but no one makes a Mac email client that can do half as much as the better Windows programs. WebSite-Watcher is another indispensable Windows program for which there is no Mac equivalent. Even in the area of text editors, I was amazed not to find anything as capable as, say, EmEditor for Windows. Which just goes to show, you can make a pretty OS, but without compelling applications it doesn't much matter. The strength of Windows is the huge variety of applications available. And given the economics, this situation is unlikely to change greatly in the future. -- John de Hoog http://dehoog.org
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads