Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
50d5e8a2
Kaydet (Commit)
50d5e8a2
authored
Mar 04, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
no longer need to include IN.py or SOCKET.py
üst
687ec189
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
broadcast.py
Demo/sockets/broadcast.py
+0
-1
mcast.py
Demo/sockets/mcast.py
+6
-9
No files found.
Demo/sockets/broadcast.py
Dosyayı görüntüle @
50d5e8a2
...
...
@@ -4,7 +4,6 @@ MYPORT = 50000
import
sys
,
time
from
socket
import
*
from
SOCKET
import
*
s
=
socket
(
AF_INET
,
SOCK_DGRAM
)
s
.
bind
((
''
,
0
))
...
...
Demo/sockets/mcast.py
Dosyayı görüntüle @
50d5e8a2
# Send/receive UDP multicast packets (SGI)
# After /usr/people/4Dgifts/examples/network/mcast.c
# Send/receive UDP multicast packets.
# Requires that your OS kernel supports IP multicast.
# This is built-in on SGI, still optional for most other vendors.
#
# Usage:
# mcast -s (sender)
# mcast -b (sender, using broadcast instead multicast)
...
...
@@ -13,8 +15,6 @@ import time
import
struct
import
regsub
from
socket
import
*
from
SOCKET
import
*
from
IN
import
*
# SGI specific!!! (Sorry)
# Main program
...
...
@@ -60,13 +60,10 @@ def receiver():
def
openmcastsock
(
group
,
port
):
# Import modules used only here
import
regsub
import
socket
import
struct
from
SOCKET
import
*
from
IN
import
*
#
# Create a socket
s
=
socket
.
socket
(
AF_INET
,
SOCK_DGRAM
)
s
=
socket
(
AF_INET
,
SOCK_DGRAM
)
#
# Allow multiple copies of this program on one machine
# (not strictly needed)
...
...
@@ -77,7 +74,7 @@ def openmcastsock(group, port):
#
# Look up multicast group address in name server
# (doesn't hurt if it is already in ddd.ddd.ddd.ddd format)
group
=
socket
.
gethostbyname
(
group
)
group
=
gethostbyname
(
group
)
#
# Construct binary group address
bytes
=
eval
(
regsub
.
gsub
(
'
\
.'
,
','
,
group
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment