150 if not self.conn then |
150 if not self.conn then |
151 verse.log("error", "Attempt to close disconnected connection - possibly a bug"); |
151 verse.log("error", "Attempt to close disconnected connection - possibly a bug"); |
152 return; |
152 return; |
153 end |
153 end |
154 local on_disconnect = self.conn.disconnect(); |
154 local on_disconnect = self.conn.disconnect(); |
|
155 self:event("shutdown"); |
155 self.conn:close(); |
156 self.conn:close(); |
156 on_disconnect(self.conn, reason); |
157 on_disconnect(self.conn, reason); |
157 end |
158 end |
158 |
159 |
159 -- Logging functions |
160 -- Logging functions |