Software /
code /
verse
Comparison
init.lua @ 95:d67ad403ca55
verse: Return false rather than nil from connect() on error, for consistency
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 21 Aug 2010 14:35:51 +0100 |
parent | 94:b40465267fb5 |
child | 96:f0aec10023aa |
comparison
equal
deleted
inserted
replaced
94:b40465267fb5 | 95:d67ad403ca55 |
---|---|
55 return false, err; | 55 return false, err; |
56 end | 56 end |
57 | 57 |
58 local conn = server.wrapclient(conn, connect_host, connect_port, new_listener(self), "*a"); | 58 local conn = server.wrapclient(conn, connect_host, connect_port, new_listener(self), "*a"); |
59 if not conn then | 59 if not conn then |
60 return nil, err; | 60 return false, err; |
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 |