MCPcopy Create free account
hub / github.com/ActiveState/code / Client

Class Client

recipes/Python/576574_Login_Logger/recipe-576574.py:95–112  ·  view source on GitHub ↗

A client for the mirror server.

Source from the content-addressed store, hash-verified

93
94
95class Client:
96
97
98
99 "A client for the mirror server."
100 def __init__(self, server, port):
101 "Connect to the given mirror server."
102 self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
103 self.socket.connect((server, port))
104
105 def mirror(self, s):
106 "Sends the given string to the server, and prints the response."
107 self.socket.send(s)
108
109
110 def close(self):
111 self.socket.send('\r\n') #We don't want to mirror anything else.
112 self.socket.close()
113
114if __name__ == '__main__':
115

Callers 2

recipe-576574.pyFile · 0.70
recipe-577232.pyFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected