CSE 461. Section 1: UDP, TCP, and addresses. Addressing. Project 0 requires sending your own IP address to another client Problem: getting own IP address can be hard How can we do it?. Getting own IP address: hostname method. Steps. Python example. Get the computer’s host name
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
name = socket.gethostname()
ip = socket.gethostbyname(name)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
ip = s.getsockname()