All pastes #960251 Raw Edit

Someone

public text v1 · immutable
#960251 ·published 2008-03-27 23:51 UTC
rendered paste body
#! /usr/bin/env python
import socket, string
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def doconn():
    sock.connect(("localhost", 1234))
def dodiscon():
    sock.close()

doconn()

while (1):
    buffer = sock.recv(1024)
    if not buffer:
        dodiscon()