<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello, Antonis!<div><br></div><div><div><div>On Jun 1, 2010, at 9:46 AM, Antonis Kaklis wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Hi to all, and since this is my first post, congratulations for the perfect framework.<br></span></blockquote><div><br></div><div>Thank you :).</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">i have the following code<font class="fixed_width" face="Courier, Monospaced"><br></font></span></blockquote><div><br></div><div>This code has two major, obvious problems:</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><font class="fixed_width" face="Courier, Monospaced">class SimpleServer(LineReceiver):&nbsp;<span class="Apple-converted-space">&nbsp;</span><br></font><p></p><p><font class="fixed_width" face="Courier, Monospaced"></font></p></span></blockquote><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><p><span class="Apple-style-span" style="font-family: Courier, Monospaced; ">&nbsp;&nbsp; &nbsp;def dataReceived(self, line):&nbsp;</span></p></span></blockquote></div>Here you say "dataReceived" receives a "line" parameter. &nbsp;But dataReceived does not receive lines, it receives *data*, i.e. arbitrary chunks of bytes. &nbsp;What you want to do is write a *line*Received method; you are already using LineReceiver, so I assume that's what you were trying to do.</div><div><br></div><div>If you fix that, the second problem is that you are creating a new XML parser for every line received. &nbsp;Is that actually what you want to do? &nbsp;Your message has some headers, which you will want to skip, and then the body of the message spans multiple lines.</div><div><br></div><div>Your "XML message" looks a lot like an HTTP POST (I am assuming the lack of spaces after the headers in your example is a typo). &nbsp;Perhaps you would be better off using the built-in HTTP server in twisted.web, rather than trying to implement your own wire-level protocol?</div><div><br></div><div>Good luck,</div><div><br></div><div>-glyph</div></body></html>