Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30573
| References | (2 earlier) <roy-A05EF0.10233530092012@news.panix.com> <mailman.1675.1349015755.27098.python-list@python.org> <roy-0C9D23.11011030092012@news.panix.com> <mailman.1677.1349019431.27098.python-list@python.org> <roy-C7A655.18142930092012@news.panix.com> |
|---|---|
| Date | 2012-10-01 09:11 +1000 |
| Subject | Re: Can somebody give me an advice about what to learn? |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1684.1349046663.27098.python-list@python.org> (permalink) |
On Mon, Oct 1, 2012 at 8:14 AM, Roy Smith <roy@panix.com> wrote: > Yeah, that's a problem. There's nothing fundamental about a TCP > connection endpoint which precludes it being serialized and passed > around. The amount of state involved is pretty small. Unless I've > forgotten something, 2 IP addresses, 2 port numbers, a few bits worth of > TCP protocol state, and, for open connections, 2 sequence numbers. > Maybe a couple of timers, but I don't think they're strictly necessary. > The problem is, most of that state is private to the kernel. And can change at a moment's notice, with no userspace interaction. The socket connection also needs to retain sent-but-not-acknowledged and received-but-not-in-order data, so those buffers need to exist. The only way would be for the kernel to export something representing a socket - which would be the file handle. And then you have to worry about any other state, eg if you're reading line by line and are retaining a partial line... not really something that can be patched in five seconds, and not IMHO worth trying to do. Easier to simply retain the process ID. Oh, and if the pid changes on a live connection, what will that do with iptables controls, which can look at the originating process's user id and such? Hrm. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Can somebody give me an advice about what to learn? tcgo <tomeuari@gmail.com> - 2012-09-30 05:58 -0700
Re: Can somebody give me an advice about what to learn? Chris Angelico <rosuav@gmail.com> - 2012-09-30 23:25 +1000
Re: Can somebody give me an advice about what to learn? Roy Smith <roy@panix.com> - 2012-09-30 10:23 -0400
Re: Can somebody give me an advice about what to learn? Chris Angelico <rosuav@gmail.com> - 2012-10-01 00:35 +1000
Re: Can somebody give me an advice about what to learn? Roy Smith <roy@panix.com> - 2012-09-30 11:01 -0400
Re: Can somebody give me an advice about what to learn? Chris Angelico <rosuav@gmail.com> - 2012-10-01 01:37 +1000
Re: Can somebody give me an advice about what to learn? Roy Smith <roy@panix.com> - 2012-09-30 18:14 -0400
Re: Can somebody give me an advice about what to learn? Chris Angelico <rosuav@gmail.com> - 2012-10-01 09:11 +1000
Re: Can somebody give me an advice about what to learn? Hans Mulder <hansmu@xs4all.nl> - 2012-10-03 19:55 +0200
Re: Can somebody give me an advice about what to learn? Chris Angelico <rosuav@gmail.com> - 2012-10-01 00:37 +1000
Re: Can somebody give me an advice about what to learn? Tim Chase <python.list@tim.thechases.com> - 2012-09-30 08:45 -0500
Re: Can somebody give me an advice about what to learn? rusi <rustompmody@gmail.com> - 2012-09-30 08:18 -0700
Re: Can somebody give me an advice about what to learn? Roy Smith <roy@panix.com> - 2012-09-30 18:17 -0400
Re: Can somebody give me an advice about what to learn? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-30 23:59 +0000
Re: Can somebody give me an advice about what to learn? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-30 16:47 +0100
Re: Can somebody give me an advice about what to learn? Wolfgang Keller <feliphil@gmx.net> - 2012-10-03 20:31 +0200
Re: Can somebody give me an advice about what to learn? Chris Rebert <clp2@rebertia.com> - 2012-10-03 21:47 -0700
Re: Can somebody give me an advice about what to learn? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-04 06:34 +0000
Re: Can somebody give me an advice about what to learn? Wolfgang Keller <feliphil@gmx.net> - 2012-10-04 19:45 +0200
csiph-web