Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30573

Re: Can somebody give me an advice about what to learn?

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'socket': 0.05; 'bits': 0.07; 'notice,': 0.07; 'exist.': 0.09; 'oh,': 0.09; 'yeah,': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hrm.': 0.16; 'kernel.': 0.16; 'oct': 0.16; 'roy': 0.16; 'seconds,': 0.16; 'tcp': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'changes': 0.20; 'trying': 0.21; 'do.': 0.21; 'received:209.85.214.174': 0.21; "i've": 0.23; 'header:In-Reply- To:1': 0.25; 'am,': 0.27; 'necessary.': 0.27; 'message- id:@mail.gmail.com': 0.27; 'buffers': 0.29; 'subject:what': 0.29; 'maybe': 0.29; 'connection': 0.30; 'problem.': 0.32; 'file': 0.32; 'retain': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'data,': 0.35; 'protocol': 0.35; 'sequence': 0.35; 'open': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'really': 0.36; 'but': 0.36; 'being': 0.37; 'passed': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'nothing': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'most': 0.61; 'export': 0.62; 'worth': 0.63; 'state,': 0.65; 'connection,': 0.71; 'smith': 0.71; 'interaction.': 0.84; 'subject:learn': 0.84; 'forgotten': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wYtstJaY0CBPGOPWT+9GhOfW2g8/aYxmOpsUgqce2PU=; b=puCKP3gy71gzmGvT59654vRcrKS/r9YNA6y5cuk4397VHKnGT1gM+ryJa2jcTqHkXm 9tqgkLC0ELhRywTkaJTsYDJCdCcOYRG/+8HS4oIEg2q+eunFvNIhv60SFLGKdSa1BrA2 cA6QWAPzTbeV+mR13HQkd4XtuCBQs9YRcPS9PZsfwI54zmUIH21Ww6nuSwJ/P1CGWxDP 6A+7+ly4l0af6NDx9D89EOK6+DecQIkiLkxL38DqM9hzYNCgqvPKGhJpWp1oXyIggr0e D1axvn3wTGRKEVrcFA8Rf8SKD5uNA+9HhMYH7LnHbSb0MhLyO671G6BGWG4Qy6WZVZi9 QQOA==
MIME-Version 1.0
In-Reply-To <roy-C7A655.18142930092012@news.panix.com>
References <15f76508-437a-4d18-ac9b-16174ef172e8@googlegroups.com> <mailman.1672.1349011558.27098.python-list@python.org> <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 Mon, 1 Oct 2012 09:11:01 +1000
Subject Re: Can somebody give me an advice about what to learn?
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1684.1349046663.27098.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1349046663 news.xs4all.nl 6867 [2001:888:2000:d::a6]:60201
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:30573

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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