7,29 → 7,24 |
import socket |
import re |
|
class NMDC(protocol.Protocol): |
class NMDC(basic.LineReceiver): |
""" |
NMDC Protocol implementation |
""" |
|
delimiter = "|" |
|
buffer = "" |
encoding = None |
hostname = None |
|
def dataReceived(self, data): |
print "Data: %s" % data |
lines = (self.buffer + data).split("|") |
print self.buffer |
for line in lines: |
if len(line) <= 2: |
continue |
print "Line: %s" % line |
command, params = self.parseLine(line) |
def lineReceived(self, line): |
print "Line Received: %s" % line |
command, params = self.parseLine(line) |
self.handleCommand(command, params) |
|
def connectionLost(self, reason): |
print "Conlost: %s" %self |
pass |
|
def connectionMade(self): |
print "Made connect" |