# - listen on the socket `sock.listen()`
# - accept `sock.accept()`
#
-# Once a connection is accepted, your class is instantiated with the client socket.
+# Once a connection is accepted, your class is instantiated with the client socket. (And the optional third argument you passed to bind_*, or None)
# - When data comes in on the client socket, your `getdata` method will be called. It should return a list of strings.
# - For each element in the list returned by `getdata`, `parse` will be called.
# - When the socket is being closed by the bot (f.e. your module is unloaded), the optional method `closing` will be called.
@lib.bind_tcp('0.0.0.0', 12543)
class BasicServer(object):
- def __init__(self, sock):
+ def __init__(self, sock, data):
self.chan = lib.parent.cfg.get('basic_socket', 'channel', '#')
self.buffer = b''
self.sock = sock