|
From: Sam S. <sd...@gn...> - 2008-12-29 20:40:10
|
Don Cohen wrote: > Sam Steingold writes: > > > I also have code for doing it from lisp if you have rawsock. > > > Let me know if you want to go down that path. > > yes, please. > > I want the code that would let me debug this without an external > > telnet. i.e., clisp should open the connection, kill it, and send a > > reset. > I'm trying to make this as simple as possible, but you'll see it's > really not there. I actually spent way too much time on this trying > to figure out what I was doing wrong before I discovered that it > behaved as I expected over the net but not for communication within > one machine (localhost). I still don't understand why that is, but > I suggest you do the testing on two different machines as described > below. I followed your instructions and I did get the error. I see what is going on, but I see no obvious way to fix this. Let us start with what we should do at the high level. We have a stream which will signal ECONNRESET on read. What should we return from SOCKET-STATUS? The doc seems to imply :ERROR, but select() (which we advertise to interface to) returns the FD as readable. Also, what should we return from LISTEN? CLHS says: On a non-interactive input-stream, listen returns true except when at end of file. What does ECONNRESET mean? SUS says that the peer did a shutdown(), so this is a kind of an EOF. but why then select says that it is readable? At any rate, I am tempted to treat this as an EOF (not least because it seems easiest to fit this condition into the trichotomy of ls_avail/ls_eof/ls_wait. especially given that on win32 we already treat WSAESHUTDOWN as eof. > BTW, as part of my search I started to suspect the checksum routines > and I did find a few small problems with them. More on that later... waiting. > Now in another process on the same client machine > > $ telnet 64.27.16.100 1234 > Trying 64.27.16.100... > Connected to 64.27.16.100 (64.27.16.100). > Escape character is '^]'. I wish this could be folded into reset.lisp. it appears that it does matter that waitforpkt is started before telnet though. |