A small Server and Client creator
Project description
This is a little library for creating Servers and Clients to send data.
Usage:
ClientStream:
myclient = Clientstream(addr, port) #Generate
myclient.connect() #Connect
myclient.setListener("connect", connect) #Replace the second argument with a function. Overgiving args:
myclient.setListener("disconnect", disconnect) #Replace the second argument with a function. Overgiving args:
myclient.setListener("recv", recv) #Replace the second argument with a function. Overgiving args: None, data
myclient.setListener("recvexception", recv) #Replace the second argument with a function. Overgiving args: exception
myclient.send("something") #Send
myclient.pause() #Pause
myclient.unpause() #Unpause
is_paused = myclient.getpaused() #Getpaused
myclient.stop() #Stop
ServerStream:
myserver = Serverstream(addr, port, maxclients) #Generate
myserver.connect() #Connect
myserver.setListener("connect", connect) #Replace the second argument with a function. Overgiving args: sock_id
myserver.setListener("disconnect", disconnect) #Replace the second argument with a function. Overgiving args: sock_id
myserver.setListener("recv", recv) #Replace the second argument with a function. Overgiving args: sock, data
myserver.setListener("recvexception", recv) #Replace the second argument with a function. Overgiving args: exception
myserver.send(sock_id "something") #Send to sock_id
myserver.pause() #Pause
myserver.unpause() #Unpause
is_paused = myserver.getpaused() #Getpaused
myserver.stop() #Stop
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for easystreaming-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39ef890446a1a3f6c903fe0ce0ca715612bdfc928c34b105b259795ec03fa39d |
|
MD5 | f1981b9ce6d6029332ec2f91c4e9e945 |
|
BLAKE2b-256 | bbcaa345fb39597ed8da48914b67be860287f93974cf1808a313a63bc516ba8f |