My simple IP Socket Server in Python

This is a small python code I wrote to create easily apps that connect using a socket.

The interface is really fast:

from easyserver import *

def on_client(info):
print “Alguien viene… ”
print info.details

def on_message(info, msg):
print “Dice: ” + msg

def on_close(info):
print “Se fue…”
print info.details

EasyServer(20000,on_client, on_message, on_close)

This will call any of those callbacks anytime somebody connects to the server listening in port 20000. More simple is impossible.

Here is the code:

One Response to “My simple IP Socket Server in Python”

  1. m.a. Says:

    Es bonico. Seguro que algún día le echo mano.

Leave a Reply

seven − 2 =