Created
August 30, 2018 11:54
-
-
Save shubham7298/e0cf2ddd40fa4556b32cda18034e763f to your computer and use it in GitHub Desktop.
Socket Programming in Python(client)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save as client.py | |
# Message Sender | |
import os | |
from socket import * | |
host = "" # set to IP address of target computer | |
port = 13000 | |
addr = (host, port) | |
UDPSock = socket(AF_INET, SOCK_DGRAM) | |
while True: | |
data = raw_input("Enter message to send or type 'exit': ") | |
UDPSock.sendto(data, addr) | |
if data == "exit": | |
break | |
UDPSock.close() | |
os._exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment