Skip to content
This repository has been archived by the owner on Oct 7, 2023. It is now read-only.

Commit

Permalink
add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
pouriya committed Aug 9, 2017
1 parent 60663d4 commit 98dc44e
Show file tree
Hide file tree
Showing 6 changed files with 501 additions and 0 deletions.
Binary file added doc/erlang.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
229 changes: 229 additions & 0 deletions doc/sockerl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Module sockerl</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>

<h1>Module sockerl</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
API functions.

<p><b>Version:</b> 17.7.10</p>
<p><b>This module defines the <tt>sockerl</tt> behaviour.</b><br> Required callback functions: <tt>connector_init/2</tt>, <tt>handle_packet/3</tt>, <tt>handle_disconnect/2</tt>, <tt>terminate/3</tt>, <tt>code_change/3</tt>.</p>
<p><b>Authors:</b> Pouriya Jahanbakhsh (<a href="mailto:pouriya.jahanbakhsh@gmail.com"><tt>pouriya.jahanbakhsh@gmail.com</tt></a>).</p>

<h2><a name="description">Description</a></h2>
API functions.
<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#add_connector-3">add_connector/3</a></td><td>
Adds new connector for Host:Port in pool.</td></tr>
<tr><td valign="top"><a href="#change_acceptor_modes-1">change_acceptor_modes/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#get_acceptor_modes-1">get_acceptor_modes/1</a></td><td>
Returns mode(s) of server acceptors.</td></tr>
<tr><td valign="top"><a href="#get_pool_connections-1">get_pool_connections/1</a></td><td>
Returns all available pool connections.</td></tr>
<tr><td valign="top"><a href="#get_server_connections-1">get_server_connections/1</a></td><td>
Returns all available server connections.</td></tr>
<tr><td valign="top"><a href="#send_async-2">send_async/2</a></td><td>
Sends packet asynchronously through connector.</td></tr>
<tr><td valign="top"><a href="#send_sync-2">send_sync/2</a></td><td>
Sends packet synchronously through connector.</td></tr>
<tr><td valign="top"><a href="#send_sync-3">send_sync/3</a></td><td>
Sends packet synchronously through connector with timeout.</td></tr>
<tr><td valign="top"><a href="#sleep_acceptors-1">sleep_acceptors/1</a></td><td>
Turns all server acceptors to sleep mode.</td></tr>
<tr><td valign="top"><a href="#start_link_connector-4">start_link_connector/4</a></td><td>
Starts and links a socket connection process.</td></tr>
<tr><td valign="top"><a href="#start_link_connector-5">start_link_connector/5</a></td><td>
Starts and links a socket connection process.</td></tr>
<tr><td valign="top"><a href="#start_link_connector-6">start_link_connector/6</a></td><td>
Starts and links a socket connection process.</td></tr>
<tr><td valign="top"><a href="#start_link_connector_pool-3">start_link_connector_pool/3</a></td><td>
Starts and links a socket connection pool.</td></tr>
<tr><td valign="top"><a href="#start_link_connector_pool-4">start_link_connector_pool/4</a></td><td>
Starts and links a socket connection pool.</td></tr>
<tr><td valign="top"><a href="#start_link_connector_pool-5">start_link_connector_pool/5</a></td><td>
Starts and links a socket connection pool.</td></tr>
<tr><td valign="top"><a href="#start_link_server-3">start_link_server/3</a></td><td>
Starts and links a socket server.</td></tr>
<tr><td valign="top"><a href="#start_link_server-4">start_link_server/4</a></td><td>
Starts and links a socket server.</td></tr>
<tr><td valign="top"><a href="#start_link_server-5">start_link_server/5</a></td><td>
Starts and links a socket server.</td></tr>
<tr><td valign="top"><a href="#stop_connector-1">stop_connector/1</a></td><td>
Stops connector.</td></tr>
<tr><td valign="top"><a href="#stop_connector-2">stop_connector/2</a></td><td>
Stops connector with specific reason.</td></tr>
<tr><td valign="top"><a href="#stop_pool-1">stop_pool/1</a></td><td>
stops pool and all connections it has.</td></tr>
<tr><td valign="top"><a href="#stop_pool-2">stop_pool/2</a></td><td>
stops pool and all connections it has with specific reason.</td></tr>
<tr><td valign="top"><a href="#stop_server-1">stop_server/1</a></td><td>
stops server and all connections it has.</td></tr>
<tr><td valign="top"><a href="#stop_server-2">stop_server/2</a></td><td>
stops server and all connections it has.</td></tr>
<tr><td valign="top"><a href="#wakeup_acceptors-1">wakeup_acceptors/1</a></td><td>
Turns all server acceptors to accept mode.</td></tr>
</table>

<h2><a name="functions">Function Details</a></h2>

<h3 class="function"><a name="add_connector-3">add_connector/3</a></h3>
<div class="spec">
<p><tt>add_connector(Pool::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>, Host::<a href="sockerl_types.html#type-host">sockerl_types:host()</a>, Port::<a href="sockerl_types.html#type-port_number">sockerl_types:port_number()</a>) -&gt; <a href="sockerl_types.html#type-start_return">sockerl_types:start_return()</a></tt><br></p>
</div><p>
Adds new connector for Host:Port in pool.</p>

<h3 class="function"><a name="change_acceptor_modes-1">change_acceptor_modes/1</a></h3>
<div class="spec">
<p><tt>change_acceptor_modes(Server::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>) -&gt; <a href="sockerl_types.html#type-acceptor_mode">sockerl_types:acceptor_mode()</a> | not_allowed</tt><br></p>
</div>

<h3 class="function"><a name="get_acceptor_modes-1">get_acceptor_modes/1</a></h3>
<div class="spec">
<p><tt>get_acceptor_modes(Server::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>) -&gt; <a href="sockerl_types.html#type-acceptor_mode">sockerl_types:acceptor_mode()</a> | [{pos_integer(), <a href="sockerl_types.html#type-acceptor_mode">sockerl_types:acceptor_mode()</a>}]</tt><br></p>
</div><p>
Returns mode(s) of server acceptors.</p>

<h3 class="function"><a name="get_pool_connections-1">get_pool_connections/1</a></h3>
<div class="spec">
<p><tt>get_pool_connections(Pool::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>) -&gt; [] | [{<a href="sockerl_types.html#type-socket">sockerl_types:socket()</a>, pid()}]</tt><br></p>
</div><p>
Returns all available pool connections.</p>

<h3 class="function"><a name="get_server_connections-1">get_server_connections/1</a></h3>
<div class="spec">
<p><tt>get_server_connections(Server::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>) -&gt; [] | [{<a href="sockerl_types.html#type-socket">sockerl_types:socket()</a>, pid()}]</tt><br></p>
</div><p>
Returns all available server connections.</p>

<h3 class="function"><a name="send_async-2">send_async/2</a></h3>
<div class="spec">
<p><tt>send_async(Con::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>, Packet::<a href="sockerl_types.html#type-packet">sockerl_types:packet()</a>) -&gt; ok</tt><br></p>
</div><p>
Sends packet asynchronously through connector.</p>

<h3 class="function"><a name="send_sync-2">send_sync/2</a></h3>
<div class="spec">
<p><tt>send_sync(Con::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>, Packet::<a href="sockerl_types.html#type-packet">sockerl_types:packet()</a>) -&gt; ok | <a href="sockerl_types.html#type-error">sockerl_types:error()</a></tt><br></p>
</div><p>
Sends packet synchronously through connector.</p>

<h3 class="function"><a name="send_sync-3">send_sync/3</a></h3>
<div class="spec">
<p><tt>send_sync(Con::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>, Packet::<a href="sockerl_types.html#type-packet">sockerl_types:packet()</a>, Timeout::timeout()) -&gt; ok | <a href="sockerl_types.html#type-error">sockerl_types:error()</a></tt><br></p>
</div><p>
Sends packet synchronously through connector with timeout.</p>

<h3 class="function"><a name="sleep_acceptors-1">sleep_acceptors/1</a></h3>
<div class="spec">
<p><tt>sleep_acceptors(Server::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>) -&gt; ok</tt><br></p>
</div><p>
Turns all server acceptors to sleep mode.</p>

<h3 class="function"><a name="start_link_connector-4">start_link_connector/4</a></h3>
<div class="spec">
<p><tt>start_link_connector(Mod::module(), InitArg::term(), Host::<a href="sockerl_types.html#type-hostname">sockerl_types:hostname()</a>, Port::<a href="sockerl_types.html#type-port_number">sockerl_types:port_number()</a>) -&gt; <a href="sockerl_types.html#type-start_return">sockerl_types:start_return()</a></tt><br></p>
</div><p>
Starts and links a socket connection process.</p>

<h3 class="function"><a name="start_link_connector-5">start_link_connector/5</a></h3>
<div class="spec">
<p><tt>start_link_connector(Name_or_Mod::<a href="sockerl_types.html#type-register_name">sockerl_types:register_name()</a> | module(), Mod_or_InitArg::module() | term(), InitArg_or_Host::term() | <a href="sockerl_types.html#type-hostname">sockerl_types:hostname()</a>, Host_or_Port::<a href="sockerl_types.html#type-hostname">sockerl_types:hostname()</a> | <a href="sockerl_types.html#type-port_number">sockerl_types:port_number()</a>, Port_or_Opts::<a href="sockerl_types.html#type-port_number">sockerl_types:port_number()</a> | <a href="sockerl_types.html#type-start_options">sockerl_types:start_options()</a>) -&gt; <a href="sockerl_types.html#type-start_return">sockerl_types:start_return()</a></tt><br></p>
</div><p>
Starts and links a socket connection process.</p>

<h3 class="function"><a name="start_link_connector-6">start_link_connector/6</a></h3>
<div class="spec">
<p><tt>start_link_connector(Name::<a href="sockerl_types.html#type-register_name">sockerl_types:register_name()</a>, Mod::module(), InitArg::term(), Host::<a href="sockerl_types.html#type-hostname">sockerl_types:hostname()</a>, Port::<a href="sockerl_types.html#type-port_number">sockerl_types:port_number()</a>, Opts::<a href="sockerl_types.html#type-start_options">sockerl_types:start_options()</a>) -&gt; <a href="sockerl_types.html#type-start_return">sockerl_types:start_return()</a></tt><br></p>
</div><p>
Starts and links a socket connection process.</p>

<h3 class="function"><a name="start_link_connector_pool-3">start_link_connector_pool/3</a></h3>
<div class="spec">
<p><tt>start_link_connector_pool(Mod::module(), InitArg::term(), Addrs::<a href="sockerl_types.html#type-addresses">sockerl_types:addresses()</a>) -&gt; <a href="sockerl_types.html#type-start_return">sockerl_types:start_return()</a></tt><br></p>
</div><p>
Starts and links a socket connection pool.</p>

<h3 class="function"><a name="start_link_connector_pool-4">start_link_connector_pool/4</a></h3>
<div class="spec">
<p><tt>start_link_connector_pool(Name_or_Mod::<a href="sockerl_types.html#type-register_name">sockerl_types:register_name()</a> | module(), Mod_or_InitArg::module() | term(), InitArg_or_Addrs::term() | <a href="sockerl_types.html#type-addresses">sockerl_types:addresses()</a>, Addrs_or_Opts::<a href="sockerl_types.html#type-addresses">sockerl_types:addresses()</a> | <a href="sockerl_types.html#type-start_options">sockerl_types:start_options()</a>) -&gt; <a href="sockerl_types.html#type-start_return">sockerl_types:start_return()</a></tt><br></p>
</div><p>
Starts and links a socket connection pool.</p>

<h3 class="function"><a name="start_link_connector_pool-5">start_link_connector_pool/5</a></h3>
<div class="spec">
<p><tt>start_link_connector_pool(Name::<a href="sockerl_types.html#type-register_name">sockerl_types:register_name()</a>, Mod::module(), InitArg::term(), Addrs::<a href="sockerl_types.html#type-addresses">sockerl_types:addresses()</a>, Opts::<a href="sockerl_types.html#type-start_options">sockerl_types:start_options()</a>) -&gt; <a href="sockerl_types.html#type-start_return">sockerl_types:start_return()</a></tt><br></p>
</div><p>
Starts and links a socket connection pool.</p>

<h3 class="function"><a name="start_link_server-3">start_link_server/3</a></h3>
<div class="spec">
<p><tt>start_link_server(Mod::module(), InitArg::term(), Port::<a href="sockerl_types.html#type-port_number">sockerl_types:port_number()</a>) -&gt; <a href="sockerl_types.html#type-start_return">sockerl_types:start_return()</a></tt><br></p>
</div><p>
Starts and links a socket server.</p>

<h3 class="function"><a name="start_link_server-4">start_link_server/4</a></h3>
<div class="spec">
<p><tt>start_link_server(Name_or_Mod::<a href="sockerl_types.html#type-register_name">sockerl_types:register_name()</a> | module(), Mod_or_InitArg::module() | term(), InitArg_or_Port::term() | <a href="sockerl_types.html#type-port_number">sockerl_types:port_number()</a>, Port_or_Opts::<a href="sockerl_types.html#type-port_number">sockerl_types:port_number()</a> | <a href="sockerl_types.html#type-start_options">sockerl_types:start_options()</a>) -&gt; <a href="sockerl_types.html#type-start_return">sockerl_types:start_return()</a></tt><br></p>
</div><p>
Starts and links a socket server.</p>

<h3 class="function"><a name="start_link_server-5">start_link_server/5</a></h3>
<div class="spec">
<p><tt>start_link_server(Name::<a href="sockerl_types.html#type-register_name">sockerl_types:register_name()</a>, Mod::module(), InitArg::term(), Port::<a href="sockerl_types.html#type-port_number">sockerl_types:port_number()</a>, Opts::<a href="sockerl_types.html#type-start_options">sockerl_types:start_options()</a>) -&gt; <a href="sockerl_types.html#type-start_return">sockerl_types:start_return()</a></tt><br></p>
</div><p>
Starts and links a socket server.</p>

<h3 class="function"><a name="stop_connector-1">stop_connector/1</a></h3>
<div class="spec">
<p><tt>stop_connector(Con::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>) -&gt; ok</tt><br></p>
</div><p>
Stops connector.</p>

<h3 class="function"><a name="stop_connector-2">stop_connector/2</a></h3>
<div class="spec">
<p><tt>stop_connector(Con::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>, Reason::any()) -&gt; ok</tt><br></p>
</div><p>
Stops connector with specific reason.</p>

<h3 class="function"><a name="stop_pool-1">stop_pool/1</a></h3>
<div class="spec">
<p><tt>stop_pool(Pool::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>) -&gt; ok</tt><br></p>
</div><p>
stops pool and all connections it has.</p>

<h3 class="function"><a name="stop_pool-2">stop_pool/2</a></h3>
<div class="spec">
<p><tt>stop_pool(Pool::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>, Reason::any()) -&gt; ok</tt><br></p>
</div><p>
stops pool and all connections it has with specific reason.</p>

<h3 class="function"><a name="stop_server-1">stop_server/1</a></h3>
<div class="spec">
<p><tt>stop_server(Server::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>) -&gt; ok</tt><br></p>
</div><p>
stops server and all connections it has.</p>

<h3 class="function"><a name="stop_server-2">stop_server/2</a></h3>
<div class="spec">
<p><tt>stop_server(Server::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>, Reason::any()) -&gt; ok</tt><br></p>
</div><p>
stops server and all connections it has.</p>

<h3 class="function"><a name="wakeup_acceptors-1">wakeup_acceptors/1</a></h3>
<div class="spec">
<p><tt>wakeup_acceptors(Server::<a href="sockerl_types.html#type-name">sockerl_types:name()</a>) -&gt; ok</tt><br></p>
</div><p>
Turns all server acceptors to accept mode.</p>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Aug 9 2017, 20:02:05.</i></p>
</body>
</html>
Loading

0 comments on commit 98dc44e

Please sign in to comment.