26 Public method to disconnect any current connection. |
26 Public method to disconnect any current connection. |
27 """ |
27 """ |
28 self.readfd = None |
28 self.readfd = None |
29 self.writefd = None |
29 self.writefd = None |
30 |
30 |
31 def setDescriptors(self,rfd,wfd): |
31 def setDescriptors(self, rfd, wfd): |
32 """ |
32 """ |
33 Public method called to set the descriptors for the connection. |
33 Public method called to set the descriptors for the connection. |
34 |
34 |
35 @param rfd file descriptor of the input file (int) |
35 @param rfd file descriptor of the input file (int) |
36 @param wfd file descriptor of the output file (int) |
36 @param wfd file descriptor of the output file (int) |
65 s = self.rbuf[:eol + 1] |
65 s = self.rbuf[:eol + 1] |
66 self.rbuf = self.rbuf[eol + 1:] |
66 self.rbuf = self.rbuf[eol + 1:] |
67 self.handleLine(s) |
67 self.handleLine(s) |
68 eol = self.rbuf.find('\n') |
68 eol = self.rbuf.find('\n') |
69 |
69 |
70 def writeReady(self,fd): |
70 def writeReady(self, fd): |
71 """ |
71 """ |
72 Public method called when we are ready to write data. |
72 Public method called when we are ready to write data. |
73 |
73 |
74 @param fd file descriptor of the file that has data to be written (int) |
74 @param fd file descriptor of the file that has data to be written (int) |
75 """ |
75 """ |
76 self.writefd.write(self.wbuf) |
76 self.writefd.write(self.wbuf) |
77 self.writefd.flush() |
77 self.writefd.flush() |
78 self.wbuf = '' |
78 self.wbuf = '' |
79 |
79 |
80 def write(self,s): |
80 def write(self, s): |
81 """ |
81 """ |
82 Public method to write a string. |
82 Public method to write a string. |
83 |
83 |
84 @param s the data to be written (string) |
84 @param s the data to be written (string) |
85 """ |
85 """ |