[9] in 6.033-lab
Re: Sequential Request ID problems
daemon@ATHENA.MIT.EDU (Nat Friedman)
Fri Mar 7 00:21:51 1997
Date: Fri, 7 Mar 1997 00:20:33 -0500
From: Nat Friedman <ndf@aleph1.mit.edu>
To: "Minh T. Thai" <mtthai@MIT.EDU>
Cc: 6.033-lab@MIT.EDU
In-Reply-To: <199703070500.AAA02989@cinderelly.mit.edu>
Minh T. Thai writes:
> But when a client crashes and restart right away it's likely that it will get the same socket fd, even though the two are different.
Sorry, I should be more clear and elaborate. Each process has its own
array of file structures, associated with that process, stored in kernel
space. The file descriptor is an index into that array. For example, by
convention, standard in is always FD 0, standard out is FD 1, standard error
FD 2. Identifying clients based on file descriptors would be a bad idea,
because it is not only possible, but extremely likely that each client's
server socket FD would be identical. However, the file structure at that
index in the per-process array would NOT. What I was talking about was
identifying clients based on their network address and their local (peer)
port. This is different from the file descriptor, and, I would bet most of
my toes, is unique for each network socket.
I hope that makes more sense.
-Nat