Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'root': 0.04; 'error:': 0.05; 'assign': 0.07; 'subject:skip:c 10': 0.07; 'subject:How': 0.09; '"can\'t': 0.09; 'indicates': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'specifying': 0.09; 'subject:set': 0.09; 'subject:using': 0.09; 'aug': 0.13; '1))': 0.16; 'bind': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 's.close()': 0.16; 'subject:type': 0.16; '>>>': 0.18; 'windows': 0.19; 'regardless': 0.21; '"",': 0.22; 'produces': 0.22; 'work.': 0.23; 'seems': 0.23; '(most': 0.27; "doesn't": 0.28; 'header:X -Complaints-To:1': 0.28; 'privileges': 0.29; 'error': 0.30; 'file': 0.32; 'traceback': 0.33; 'url:home': 0.33; 'to:addr :python-list': 0.33; "can't": 0.34; 'subject:?': 0.35; 'received:org': 0.36; 'url:org': 0.36; 'charset:us-ascii': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'address': 0.60; 'range': 0.60; 'skip:u 10': 0.60; 'link': 0.60; 'confirm': 0.64; 'gave': 0.65; 'dhcp': 0.84; 'dennis': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: How to set the socket type and the protocol of a socket using create_connection? Date: Tue, 21 Aug 2012 15:28:37 -0400 Organization: > Bestiaria Support Staff < References: <4edc5ccb-9121-47b0-8ad4-2bf106735532@googlegroups.com> <50323dc7$0$6841$e4fe514c@news2.news.xs4all.nl> <7e4fbbae-a70f-42fc-82c9-a03f1a118136@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-27-81.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345577311 news.xs4all.nl 6967 [2001:888:2000:d::a6]:39839 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27591 On Tue, 21 Aug 2012 10:00:28 -0700 (PDT), Guillaume Comte declaimed the following in gmane.comp.python.general: > Unfortunatly, my_socket.bind((src_addr, 1)) doesn't work. I get the error message: "socket.error: [Errno 49] Can't assign requested address"... Port #1 is in the range of OS privileged ports; you may need root privileges to bind to it. http://www.w3.org/Daemon/User/Installation/PrivilegedPorts.html {Note: one link I hit indicates that M$ Windows does not have this restriction; and >>> s = socket.socket(socket.AF_INET) >>> s.bind(("", 1)) >>> seems to confirm that... OTOH: specifying an invalid IP address regardless of port produces >>> s.bind(("192.168.1.10", 1)) Traceback (most recent call last): File "", line 1, in File "", line 1, in bind error: (10049, "Can't assign requested address") >>> whereas using the DHCP assigned address gave >>> s.close() >>> s = socket.socket(socket.AF_INET) >>> s.bind(("192.168.2.101", 1)) >>> } -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/