"""Create a client object connected to the specified
server. `sk' can either be a socket object, which is used as
it is, or a string specification very similar to the
- specification for pdm.srv.listen, so see its documentation for
- details. The differences are only that this function does not
- take arguments specific to socket creation, like the mode and
- group arguments for Unix sockets. If `proto' is given, that
- subprotocol will negotiated with the server (by calling the
- select() method).
+ specification for L{pdm.srv.listen}, so see its documentation
+ for details. The differences are only that this function does
+ not take arguments specific to socket creation, like the mode
+ and group arguments for Unix sockets. If `proto' is given,
+ that subprotocol will negotiated with the server (by calling
+ the select() method).
"""
self.sk = resolve(sk)
- self.buf = ""
+ self.buf = b""
line = self.readline()
- if line != "+PDM1":
+ if line != b"+PDM1":
raise protoerr("Illegal protocol signature")
if proto is not None:
self.select(proto)