Last active
April 6, 2016 11:38
-
-
Save abhigenie92/f86039a655f218493c579ea4a7296981 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stroke_client.py | |
from twisted.internet.protocol import Protocol, ClientFactory | |
class StrokeClientFactory(ClientFactory): | |
def buildProtocol(self, addr): | |
return StrokeClient(self) | |
class StrokeClient(Protocol): | |
def __init__(self, factory): | |
self. factory = factory | |
self.recv_data='' | |
def connectionMade(self): | |
print "Connected to remote server" | |
def dataReceived(self,data): | |
pass | |
============================================= | |
from stroke_client import StrokeClientFactory | |
self.stroke_conn=reactor.connectTCP(server_addr_ip_addr,self.stroke_port,StrokeClientFactory()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment