no longer need to include IN.py or SOCKET.py

This commit is contained in:
Guido van Rossum 1995-03-04 22:57:56 +00:00
parent 687ec1892b
commit 50d5e8a23a
2 changed files with 6 additions and 10 deletions

View File

@ -4,7 +4,6 @@ MYPORT = 50000
import sys, time import sys, time
from socket import * from socket import *
from SOCKET import *
s = socket(AF_INET, SOCK_DGRAM) s = socket(AF_INET, SOCK_DGRAM)
s.bind(('', 0)) s.bind(('', 0))

View File

@ -1,5 +1,7 @@
# Send/receive UDP multicast packets (SGI) # Send/receive UDP multicast packets.
# After /usr/people/4Dgifts/examples/network/mcast.c # Requires that your OS kernel supports IP multicast.
# This is built-in on SGI, still optional for most other vendors.
#
# Usage: # Usage:
# mcast -s (sender) # mcast -s (sender)
# mcast -b (sender, using broadcast instead multicast) # mcast -b (sender, using broadcast instead multicast)
@ -13,8 +15,6 @@ import time
import struct import struct
import regsub import regsub
from socket import * from socket import *
from SOCKET import *
from IN import * # SGI specific!!! (Sorry)
# Main program # Main program
@ -60,13 +60,10 @@ def receiver():
def openmcastsock(group, port): def openmcastsock(group, port):
# Import modules used only here # Import modules used only here
import regsub import regsub
import socket
import struct import struct
from SOCKET import *
from IN import *
# #
# Create a socket # 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 # Allow multiple copies of this program on one machine
# (not strictly needed) # (not strictly needed)
@ -77,7 +74,7 @@ def openmcastsock(group, port):
# #
# Look up multicast group address in name server # Look up multicast group address in name server
# (doesn't hurt if it is already in ddd.ddd.ddd.ddd format) # (doesn't hurt if it is already in ddd.ddd.ddd.ddd format)
group = socket.gethostbyname(group) group = gethostbyname(group)
# #
# Construct binary group address # Construct binary group address
bytes = eval(regsub.gsub('\.', ',', group)) bytes = eval(regsub.gsub('\.', ',', group))