|
Initiates a connection to IRC server.
- Parameters:
-
| session | A session to initiate connections on. Must not be NULL. |
| server | A domain name or an IP address of the IRC server to connect to. Must not be NULL. |
| port | An IRC server port, usually 6667. |
| server_password | An IRC server password, if the server requires it. May be NULL, in this case password will not be send to the IRC server. |
| nick | A nick, which libircclient will use to login to the IRC server. Must not be NULL. |
| username | A username of the account, which is used to connect to the IRC server. This is for information only, will be shown in "user properties" dialogs and returned by /whois request. May be NULL, in this case 'nobody' will be sent as username. |
| realname | A real name of the person, who connects to the IRC. Usually people put some wide-available information here (URL, small description or something else). This information also will be shown in "user properties" dialogs and returned by /whois request. May be NULL, in this case 'noname' will be sent as username. |
- Returns:
- Return code 0 means success. Other value means error, the error code may be obtained through irc_errno(). Any error, generated by the IRC server, is available through irc_callbacks_t::event_numeric.
This function prepares and initiates a connection to the IRC server. The connection is done asynchronously (see irc_callbacks_t::event_connect), so the success return value means that connection was initiated (but not completed!) successfully.
- See also:
- irc_run
|