package irc-client-unix

  1. Overview
  2. Docs
IRC client library - Unix implementation

Install

Dune Dependency

Authors

Maintainers

Sources

irc-client.0.7.1.tar.gz
sha256=ed339aaa57ffd628958b09e33605c7c90a8072cc0827dca34ef0b2344a576538

doc/irc-client-unix/Irc_client_unix/index.html

Module Irc_client_unixSource

include Irc_client.CLIENT with type 'a Io.t = 'a and type Io.inet_addr = Unix.inet_addr and type Io.config = unit
Sourcemodule Io : sig ... end
Sourcetype connection_t
Sourceval send : connection:connection_t -> Irc_message.t -> unit Io.t

Send the given message

Sourceval send_join : connection:connection_t -> channel:string -> unit Io.t

Send the JOIN command.

Sourceval send_nick : connection:connection_t -> nick:string -> unit Io.t

Send the NICK command.

Sourceval send_pass : connection:connection_t -> password:string -> unit Io.t

Send the PASS command.

Sourceval send_pong : connection:connection_t -> message1:string -> message2:string -> unit Io.t

Send the PONG command.

Sourceval send_privmsg : connection:connection_t -> target:string -> message:string -> unit Io.t

Send the PRIVMSG command.

Sourceval send_notice : connection:connection_t -> target:string -> message:string -> unit Io.t

Send the NOTICE command.

Sourceval send_quit : ?msg:string -> connection:connection_t -> unit -> unit Io.t

Send the QUIT command.

Sourceval send_user : connection:connection_t -> username:string -> mode:int -> realname:string -> unit Io.t

Send the USER command.

Sourceval connect : ?username:string -> ?mode:int -> ?realname:string -> ?password:string -> ?sasl:bool -> ?config:Io.config -> addr:Io.inet_addr -> port:int -> nick:string -> unit -> connection_t Io.t

Connect to an IRC server at address addr. The PASS command will be sent if password is not None and if sasl is false.

  • parameter sasl

    if true, try to use SASL (plain) authentication with the server. This is an IRCv3 extension and might not be supported everywhere; it might also require a secure transport (see Irc_client_lwt_ssl or Irc_client_tls for example). This param exists

    @since 0.7.

Sourceval connect_by_name : ?username:string -> ?mode:int -> ?realname:string -> ?password:string -> ?sasl:bool -> ?config:Io.config -> server:string -> port:int -> nick:string -> unit -> connection_t option Io.t

Try to resolve the server name using DNS, otherwise behaves like connect. Returns None if no IP could be found for the given name. See connect for more details.

Sourcetype keepalive = {
  1. mode : [ `Active | `Passive ];
  2. timeout : int;
}

Information on keeping the connection alive

Sourceval default_keepalive : keepalive

Default value for keepalive: active mode with auto-reconnect

Sourceval listen : ?keepalive:keepalive -> connection:connection_t -> callback:(connection_t -> Irc_message.parse_result -> unit Io.t) -> unit -> unit Io.t

listen connection callback listens for incoming messages on connection. All server pings are handled internally; all other messages are passed, along with connection, to callback.

Sourceval reconnect_loop : ?keepalive:keepalive -> ?reconnect:bool -> after:int -> connect:(unit -> connection_t option Io.t) -> f:(connection_t -> unit Io.t) -> callback:(connection_t -> Irc_message.parse_result -> unit Io.t) -> unit -> unit Io.t

A combination of connect and listen that, every time the connection is terminated, tries to start a new one after after seconds. It stops reconnecting if the exception Exit is raised.

  • parameter after

    time before trying to reconnect

  • parameter callback

    the callback for listen

  • parameter f

    the function to call after connection

OCaml

Innovation. Community. Security.