HOME/Articles/

socket example 0 this works (snippet)

Article Outline

Python socket example '0 this works'

Modules used in program:

  • import socket

python 0 this works

Python socket example: 0 this works

import socket

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

s.bind(('', 5556))
s.connect(('192.168.1.1', 5556))

s.send(b'first')
s.send(b'second')