K
kaklis
Hi in the following code
class MyClientHandler(SocketServer.BaseRequestHandler):
def handle(self):
print self.client_address, now( )
time.sleep(5)
while True:
xmltxt = self.request.recv(1024) <--is this ok -
enough?
if not xmltxt: break
doc = minidom.parseString(data)
<--- it also fails for parse(data)
rootNode = doc.documentElement
level = 0
walk(rootNode, outFile, level)
<---just a function to print the xml
self.request.send('Echo=>%s at %s' % (data, now( )))
rootNode = doc.documentElement
level = 0
walk(rootNode, outFile, level)
self.request.send('Echo=>%s at %s' % (data, now( )))
self.request.close( )
# make a threaded server, listen/handle clients forever
myaddr = (myHost, myPort)
server = SocketServer.ThreadingTCPServer(myaddr, MyClientHandler)
server.serve_forever( )
I want to send XML messages from my client. The server sends back the
XML it receives but
the parser exits with error codes.
What am i doing wrong.
Thanks in advance
class MyClientHandler(SocketServer.BaseRequestHandler):
def handle(self):
print self.client_address, now( )
time.sleep(5)
while True:
xmltxt = self.request.recv(1024) <--is this ok -
enough?
if not xmltxt: break
doc = minidom.parseString(data)
<--- it also fails for parse(data)
rootNode = doc.documentElement
level = 0
walk(rootNode, outFile, level)
<---just a function to print the xml
self.request.send('Echo=>%s at %s' % (data, now( )))
rootNode = doc.documentElement
level = 0
walk(rootNode, outFile, level)
self.request.send('Echo=>%s at %s' % (data, now( )))
self.request.close( )
# make a threaded server, listen/handle clients forever
myaddr = (myHost, myPort)
server = SocketServer.ThreadingTCPServer(myaddr, MyClientHandler)
server.serve_forever( )
I want to send XML messages from my client. The server sends back the
XML it receives but
the parser exits with error codes.
What am i doing wrong.
Thanks in advance