Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Closed Connection Does Not Trigger httpClient.response "end" event
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tautologistics  
View profile  
 More options May 5 2010, 9:38 am
From: Tautologistics <cpt.obvi...@gmail.com>
Date: Wed, 5 May 2010 06:38:54 -0700 (PDT)
Local: Wed, May 5 2010 9:38 am
Subject: [nodejs] Closed Connection Does Not Trigger httpClient.response "end" event
Just an FYI about this quirk I just encountered. I close the
connection is the server response is bigger than I want but was not
getting an "end" event on the response. Here's the workaround:

request.addListener('response', function (response) {
                sys.debug("RESPONSE");

                response.setEncoding('utf8');
                var responseAborted = false;
                var contentLength = response.headers["content-length"] || 0;
                function abort () {
                        if (!responseAborted) {
                                response.connection.addListener("close", function () {
                                        sys.debug("CLOSE");
                                        response.emit("end", true);
                                });
                                responseAborted = true;
                                response.connection.end();
                        }
                }

                if (contentLength > 1024) {
                        abort();
                } else {
                        var contentLengthRecv = 0;
                        response.addListener('data', function (chunk) {
                                contentLengthRecv += chunk.length;
                                sys.debug("DATA " + contentLength + ":" + contentLengthRecv);
                                if (contentLengthRecv > 1024) {
                                        abort();
                                }
                        });
                }
                response.addListener('end', function (forceClosed) {
                        sys.debug("END");
                });
        });
request.end();

--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com.
To unsubscribe from this group, send email to nodejs+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Nov 6 2012, 3:13 am
From: Tom <tommed...@gmail.com>
Date: Tue, 6 Nov 2012 00:13:21 -0800 (PST)
Local: Tues, Nov 6 2012 3:13 am
Subject: Re: [nodejs] Closed Connection Does Not Trigger httpClient.response "end" event

This still hasn't been fixed. Any news on the situation?

Op woensdag 5 mei 2010 20:38:54 UTC+7 schreef Tautologistics het volgende:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Jan 21, 12:18 pm
From: Tom <tommed...@gmail.com>
Date: Mon, 21 Jan 2013 09:18:59 -0800 (PST)
Local: Mon, Jan 21 2013 12:18 pm
Subject: Re: [nodejs] Closed Connection Does Not Trigger httpClient.response "end" event

Still no updates on the matter?

This still hasn't been fixed. Any news on the situation?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »