Skip to content

Instantly share code, notes, and snippets.

@mvgolom
Created July 10, 2021 21:36
Show Gist options
  • Save mvgolom/d7d1ea585b29dddcf48ec64edfcc0a5b to your computer and use it in GitHub Desktop.
Save mvgolom/d7d1ea585b29dddcf48ec64edfcc0a5b to your computer and use it in GitHub Desktop.
import socket
HOST = '127.0.0.1' # Endereco IP do Servidor
PORT = 5000 # Porta que o Servidor esta
tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
dest = (HOST, PORT)
tcp.connect(dest)
print 'Para sair use CTRL+X\n'
msg = raw_input()
while msg <> '\x18':
tcp.send (msg)
msg = raw_input()
tcp.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment