[Twisted-Python] twistedmatrix client

I am new to python and twistedmatrix, so any help would be great. I have been able to write a server and connect to it via python sockets. But I would like to figure out how to create a twisted client. But, I have found no docs on creating clients. Is there some place that I can look for docs, or can some one help me with client setup. What I am passing to the client from the server is a simple list with four items. Thanks for the help -- Kelly Roestel Network Admin DolphinSearch, Inc

Kelly Roestel wrote:
# here's an example of a client that connects to "foobar.com" # on port 8023 from twisted.protocols import protocol from twisted.internet import main, tcp class MyProtocol(protocol.Protocol): def connectionMade(self): self.transport.write("hello") def dataReceived(self, data): print "server sent me data, yay!", data p = MyProtocol() tcp.Client("foobar.com", 8023, p) # start the event loop main.run()

Kelly Roestel wrote:
# here's an example of a client that connects to "foobar.com" # on port 8023 from twisted.protocols import protocol from twisted.internet import main, tcp class MyProtocol(protocol.Protocol): def connectionMade(self): self.transport.write("hello") def dataReceived(self, data): print "server sent me data, yay!", data p = MyProtocol() tcp.Client("foobar.com", 8023, p) # start the event loop main.run()
participants (2)
-
Itamar Shtull-Trauring
-
Kelly Roestel