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


Groups > comp.lang.python > #52894

Re: How to send broadcast IP address to network?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.037
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'context': 0.07; 'socket': 0.07; 'here?': 0.09; 'subject:How': 0.10; '23,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'port))': 0.16; 'subject:send': 0.16; 'tcp': 0.16; 'wrote:': 0.18; 'aug': 0.22; 'connected': 0.24; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; 'code': 0.31; 'lines': 0.31; 'thanks!': 0.32; 'fri,': 0.33; "can't": 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'address.': 0.39; 'establish': 0.61; 'show': 0.63; 'more': 0.64; 'broadcast': 0.68; 'home': 0.69; 'computers': 0.72; '10:32': 0.84; '2013': 0.98
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=e/4lsUsIksecyaG1Fe2MWgYBNjP+HQzSzM39tzT8avY=; b=eoaHRu18djBx/tYXAn/exgO144SqWoEov9NRRcI+uAFnZ1Fr/q322KoMsO0V/RpKRn jgzmRg7KwYcYQSC38mUJMyGCgG06TFTUaFh4zsPSivJ/y8leEl1Uayj/03HsWVbu2tvS /V0LYSWB7xnXgk27TOI3lDNCpCPEYX8+3VclvO5sGdgi3Qc0JgDpuq7RHw5/rjH0uvs/ c4HBDjmezQkauT/ZJsTLzw71RNWFKXO9dqw+72jgrTvg2HLVzlZ5HQgDIscq8HZXPCgh /2ylY4PBMpC2Z6v4QM0RK8uBrvfZ3wNtXrQjDRfZ+m7ay/OY4x5gbbvO/vXymzaiOHQe 706g==
MIME-Version 1.0
X-Received by 10.52.92.15 with SMTP id ci15mr191130vdb.34.1377267067819; Fri, 23 Aug 2013 07:11:07 -0700 (PDT)
In-Reply-To <659fa544-4fd6-406c-ad44-aa155e2c0e40@googlegroups.com>
References <659fa544-4fd6-406c-ad44-aa155e2c0e40@googlegroups.com>
Date Sat, 24 Aug 2013 00:11:07 +1000
Subject Re: How to send broadcast IP address to network?
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.165.1377267420.19984.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1377267420 news.xs4all.nl 15883 [2001:888:2000:d::a6]:34524
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52894

Show key headers only | View raw


On Fri, Aug 23, 2013 at 10:32 PM,  <lightaiyee@gmail.com> wrote:
> I want to send a broadcast packet to all the computers connected to my home router.
>
> The following 2 lines of code do not work;
> host="192.168.0.102"
> s.connect((host, port))
>
> Can someone advise?

You can't establish a TCP socket with a broadcast address. That just
doesn't work. Can you please show a whole lot more context so we can
see what's happening here? Thanks!

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to send broadcast IP address to network? lightaiyee@gmail.com - 2013-08-23 05:32 -0700
  Re: How to send broadcast IP address to network? lightaiyee@gmail.com - 2013-08-23 05:36 -0700
    Re: How to send broadcast IP address to network? Neil Cerutti <neilc@norwich.edu> - 2013-08-23 13:05 +0000
  Re: How to send broadcast IP address to network? Chris Angelico <rosuav@gmail.com> - 2013-08-24 00:11 +1000
  Re: How to send broadcast IP address to network? Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2013-08-24 13:33 +0200

csiph-web