Skip to content

Instantly share code, notes, and snippets.

View mcagriaksoy's full-sized avatar
homo_sapiens.py

Mehmet Cagri Aksoy mcagriaksoy

homo_sapiens.py
View GitHub Profile
@mcagriaksoy
mcagriaksoy / python_simple_chat
Created September 3, 2018 11:10 — forked from mako34/python_simple_chat
Python simple chat test, server and client
#server
# TCP Server Code
#host="127.0.0.1" # Set the server address to variable host
host="127.168.2.75" # Set the server address to variable host
port=4446 # Sets the variable port to 4444
from socket import * # Imports socket module
s=socket(AF_INET, SOCK_STREAM)
s.bind((host,port)) # Binds the socket. Note that the input to
@mcagriaksoy
mcagriaksoy / client.py
Created August 31, 2018 07:16 — forked from ninedraft/README.md
Python udp broadcast client server example
import socket
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
client.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
client.bind(("", 37020))
while True:
data, addr = client.recvfrom(1024)
print("received message: %s"%data)