def __init__(self, host, port=<NUM_LIT>, username="<STR_LIT>", password="<STR_LIT>", timeout=<NUM_LIT:30>, use_ssl=False):
self.socket = socket.socket()<EOL>if use_ssl:<EOL><INDENT>self.socket = ssl.wrap_socket(self.socket)<EOL><DEDENT>self.socket.settimeout(timeout)<EOL>self.__buffer = fifo.Fifo()<EOL>self.__generating = False<EOL>self.username = username<EOL>self.password = password<EOL>self.socket.connect((host, port))<EOL>code, message = self.status()<EOL>if not code in [<NUM_LIT:200>, <NUM_LIT>]:<EOL><INDENT>raise NNTPReplyError(code, message)<EOL><DEDENT>
Constructor for BasicNNTPClient.

        Connects to usenet server and enters reader mode.

        Args:
            host: Hostname for usenet server.
            port: Port for usenet server.
            username: Username for usenet account (default "anonymous")
            password: Password for usenet account (default "anonymous")
            timeout: Connection timeout (default 30 seconds)
            use_ssl: Should we use ssl (default False)

        Raises:
            IOError (socket.error): On error in underlying socket and/or ssl
                wrapper. See socket and ssl modules for further details.
            NNTPReplyError: On bad response code from server.