re-org + comments

This commit is contained in:
meejah 2021-04-02 23:05:52 -06:00
parent 2d506de55a
commit 2903c7f2a0

View File

@ -81,6 +81,8 @@ class ServerBase:
_received = b"" _received = b""
connected = False connected = False
# override Protocol callbacks
def connectionMade(self): def connectionMade(self):
self.connected = True self.connected = True
return Protocol.connectionMade(self) return Protocol.connectionMade(self)
@ -89,15 +91,17 @@ class ServerBase:
self.connected = False self.connected = False
return Protocol.connectionLost(self, reason) return Protocol.connectionLost(self, reason)
def dataReceived(self, data):
self._received = self._received + data
# ITransitClient API
def send(self, data): def send(self, data):
self.transport.write(data) self.transport.write(data)
def disconnect(self): def disconnect(self):
self.transport.loseConnection() self.transport.loseConnection()
def dataReceived(self, data):
self._received = self._received + data
def reset_received_data(self): def reset_received_data(self):
self._received = b"" self._received = b""