Skip to content

Instantly share code, notes, and snippets.

View celikelozdinc's full-sized avatar
🏠
Working from home

celikelozdinc celikelozdinc

🏠
Working from home
View GitHub Profile
@celikelozdinc
celikelozdinc / Python TCP Client Example.py
Created February 21, 2019 17:19 — forked from Integralist/Python TCP Client Example.py
Python TCP Client Server Example
import socket
hostname, sld, tld, port = 'www', 'integralist', 'co.uk', 80
target = '{}.{}.{}'.format(hostname, sld, tld)
# create an ipv4 (AF_INET) socket object using the tcp protocol (SOCK_STREAM)
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# connect the client
# client.connect((target, port))