Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.129 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.75; '*S*': 0.01; '16,': 0.03; 'assuming': 0.09; 'credentials,': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'disconnect': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'governed': 0.16; 'half.': 0.16; 'letting': 0.16; 'tcp': 0.16; 'wing': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; '(not': 0.18; 'thu,': 0.19; 'cc:addr:python.org': 0.22; '(or': 0.24; 'cc:2**0': 0.24; '15,': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'ray': 0.31; 'another': 0.32; 'open': 0.33; 'connection': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'half': 0.37; 'server': 0.38; 'connections': 0.38; 'mine': 0.38; 'handle': 0.38; 'resource': 0.38; 'bad': 0.39; "couldn't": 0.39; 'extremely': 0.39; 'sure': 0.39; 'solve': 0.60; 'introduced': 0.61; 'such': 0.63; 'minutes': 0.67; 'between': 0.67; 'gathering': 0.68; 'internet': 0.71; 'carefully': 0.74; 'yourself': 0.78; 'invitation': 0.79; 'protect': 0.79; 'friend': 0.79; 'william': 0.81; '2014,': 0.84; 'break.': 0.84; 'closes': 0.84; 'frustrating': 0.84; 'holes': 0.84; 'off,': 0.84; 'presumption': 0.84; 'to:none': 0.92 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:cc :content-type; bh=ZF8m02M4Z1HAL3+NTb8K70mUJx0fuLlAxgHCd9GiNEU=; b=vgCRZ1ZCALRnifTHf8EtrlWBB+bbvo8WWbYb58M6QaiBbXBda4AFANUSqgMy9f6c7b 3aY41tmnuOHDuC4iJsEGlrB70Nbi1QEK/EhenvM/OLGs/O/lEDNiDKSlQEZe5zB9uyEX owvo07gZEed7Z8LkRWbr3tzMgDr02OK7k+RMyAVD+dI35hWzNd8GxU12yx4A1cuPF5On JrZ66FDf2LOyMCVRtajrwzSb+m3ykmrpCBR2DI85WNEmyRWxZrlzEwm0qq70wr+lBCpq Hy48Q1kvfMoxbMnctpgJD6zM3akxuAjNZfftt91cSMmD+Z4TDSnLe7s0CPLwZhAyTHoP 6lcA== MIME-Version: 1.0 X-Received: by 10.66.102.39 with SMTP id fl7mr3823500pab.43.1389803463716; Wed, 15 Jan 2014 08:31:03 -0800 (PST) In-Reply-To: <7B721FFF-5F01-4736-AC82-B5E71848F926@mac.com> References: <22d58d76-f2c2-4a1d-8049-3409ac4665d3@googlegroups.com> <9202d352-e065-4f2b-a9e0-e29ce5c68df6@googlegroups.com> <7B721FFF-5F01-4736-AC82-B5E71848F926@mac.com> Date: Thu, 16 Jan 2014 03:31:03 +1100 Subject: Re: Learning python networking From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389803466 news.xs4all.nl 2950 [2001:888:2000:d::a6]:50700 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63996 On Thu, Jan 16, 2014 at 3:25 AM, William Ray Wing wrote: > On Jan 15, 2014, at 7:52 AM, Chris Angelico wrote: >> One of the fundamentals of the internet is that connections *will* >> break. A friend of mine introduced me to Magic: The Gathering via a >> program that couldn't handle drop-outs, and it got extremely >> frustrating - we couldn't get a game going. Build your server such >> that your clients can disconnect and reconnect, and you protect >> yourself against half the problem; allow them to connect and kick the >> other connection off, and you solve the other half. > > But note VERY carefully that this can open HUGE security holes if not done with extreme care. > > Leaving a dangling connection (not session, TCP closes sessions) open is an invitation so bad things happening. Not sure what you mean here. I'm assuming an authentication system that stipulates one single active connection per authenticated user (if you reauthenticate with the same credentials, it'll disconnect the other one on the presumption that the connection's been lost). In terms of resource wastage, there's no difference between disconnecting now and letting it time out, and waiting the ten minutes (or whatever) and then terminating cleanly. Or do you mean another user gaining access? It's still governed by the same authentication. ChrisA