[Zope] TCPWatch... and closing sockets..

Steve Spicklemire steve@spvi.com
Mon, 22 Jan 2001 17:02:55 -0500 (EST)


Well proxy_receiver seems to set it's terminator to 'None', which
seems to indicate that the dispatcher should just send it all as it
comes without checking for any special terminator (which is indeed
what appears to be happening!)  The problem is that this dispatcher
code:

          def recv (self, buffer_size):
		try:
			data = self.socket.recv (buffer_size)
			if not data:
				# a closed connection is indicated by signaling
				# a read condition, and having recv() return 0.
				self.handle_close()
				return ''
			else:
				return data

is never called at a time when self.socket.recv() returns ''. I think this
is the normal signal for a closed socket... so if it's never getting an
empty string... does that mean the socket is not closed correctly?
Should ayncore be changed so that handle_close() is called whenever 
close() is called (unless it has already been called in recv)? 
I'm guessing that the OS takes care of any handles that may be left
dangling here... if any.

thanks,
-steve

>>>>> "kapil" == ender  <kthangavelu@earthlink.net> writes:

    kapil> i'm guessing this has something to do with the default line
    kapil> terminators that medusa is looking for before it senses
    kapil> that a data buffer is ready to be processed. it seems like
    kapil> the url encoded ones request seem to have different line
    kapil> terminators. you can adjust this the fly by using the
    kapil> set_terminator() func on the dispatcher. set_terminator can
    kapil> look for either a set of input chars, or you can adjust the
    kapil> data buffers to fire off for processing on integer sizes.

    kapil> hope that helps

    kapil> kapil