61 end |
61 end |
62 |
62 |
63 self.conn = conn; |
63 self.conn = conn; |
64 local w, t = conn.write, tostring; |
64 local w, t = conn.write, tostring; |
65 self.send = function (_, data) return w(conn, t(data)); end |
65 self.send = function (_, data) return w(conn, t(data)); end |
|
66 return true; |
|
67 end |
|
68 |
|
69 function stream:close() |
|
70 local on_disconnect = self.conn.disconnect(); |
|
71 self.conn:close(); |
|
72 on_disconnect(conn, reason); |
66 end |
73 end |
67 |
74 |
68 -- Logging functions |
75 -- Logging functions |
69 function stream:debug(...) |
76 function stream:debug(...) |
70 if self.logger and self.log.debug then |
77 if self.logger and self.log.debug then |