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
a1b51f37
Kaydet (Commit)
a1b51f37
authored
Eki 25, 1992
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed comments
üst
f3994ff9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
mcast.py
Demo/sockets/mcast.py
+4
-4
No files found.
Demo/sockets/mcast.py
Dosyayı görüntüle @
a1b51f37
...
...
@@ -34,13 +34,13 @@ if sender:
s
.
sendto
(
data
,
(
mygroup
,
MYPORT
))
time
.
sleep
(
1
)
else
:
# Bind the socket to my port
s
.
bind
(
''
,
MYPORT
)
# Allow multiple copies of this program on one machine
s
.
setsockopt
(
SOL_SOCKET
,
SO_REUSEPORT
,
1
)
# (Not strictly needed)
# Ugly: construct binary group address from MYGROUP converted to bytes
# Bind the socket to my port
s
.
bind
(
''
,
MYPORT
)
# Construct binary group address from MYGROUP converted to bytes
bytes
=
eval
(
regsub
.
gsub
(
'
\
.'
,
','
,
MYGROUP
))
grpaddr
=
0
for
byte
in
bytes
:
grpaddr
=
(
grpaddr
<<
8
)
|
byte
...
...
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