<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
You mean the documentation is available as man pages?!!<br>
I've been using the erlang.org web site as my html lookup resource<br>
but I'd prefer man pages. Doing something in the shell is _so_<br>
much quicker.<br>
<br>
How would I get the Erlang man pages into my system?<br>
<br>
~Thomas<br>
<br>
<br>
<br>
Scott Lystig Fritchie wrote:<br>
<blockquote type="cite"
cite="mid200305310637.h4V6bUjD017403@snookles.snookles.com">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">"nd" == Niall Dalton <a class="moz-txt-link-rfc2396E" href="mailto:ndalton@lastminute.com"><ndalton@lastminute.com></a> writes:
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->
nd> Hello, Does anyone have experience using accept filters on FreeBSD
nd> in Erlang applications?
I'd never even heard of them until you mentioned them. I should spend
more time reading "man" pages. :-)
There's an undocumented function in the inet module that you could use
to get the OS file descriptor associated with the socket.
% erl
Erlang (BEAM) emulator version 5.2.3.3 [source] [<a class="moz-txt-link-freetext" href="threads:0">threads:0</a>]
Eshell V5.2.3.3 (abort with ^G)
1> {ok, Port} = gen_<a class="moz-txt-link-freetext" href="tcp:connect(">tcp:connect(</a>"localhost", 25, []).
{ok,#Port<0.28>}
2> <a class="moz-txt-link-freetext" href="inet:getfd(Port">inet:getfd(Port</a>).
{ok,7}
3>
According to the accf_http(9) man page, you'd need to call
setsockopt() to invoke the proper magic. However, the inets driver
doesn't know how to do that. Your options are:
1. Hack your "beam<a class="moz-txt-link-rfc2396E" href="executabletoaddthesockoptyouneed.2.Createalinked-indriverthatwouldtakethefiledescriptorfrominet:getfd()andinvokethesetsockopt()asrequired.#2wouldbereallyeasytodowithEDTK.Seehttp://www.snookles.com/erlang/edtk/forthesourcecode.Sorryit'sahassletosetup,butitreallydoesworkquitewellonceyou'vecompiledthe">" executable to add the sockopt you need.
2. Create a linked-in driver that would take the file descriptor from
inet:getfd() and invoke the setsockopt() as required.
#2 would be really easy to do with EDTK. See
http://www.snookles.com/erlang/edtk/ for the source code. Sorry it's
a hassle to set up, but it really does work quite well once you've
compiled the "</a>gslgen" utility.
Though I haven't tested it, this ought to work pretty well. Writing
int my_setsockopt(int) is easy enough -- put it in my-sockopt.{h,c}.
<erldriver name="simple0_drv" abbrev="" default_debug_verbose="0">
<summary>A very simple setsockopt() driver</summary>
<verbatim place="top_cpp_stuff">
#include <errno.h>
#include <my-sockopt.h> /* Just for prototype */
</verbatim>
<func name="my_sockopt">
<arg name="fd" ctype="int"/>
<return ctype="int" name="ret_int" expect="== 0" expect_errval="errno"/>
</func>
</erldriver>
To make your life easier (probably), borrow the Makefile from the
examples/simple0 driver to assist compiling & linking everything.
-Scott
</pre>
</blockquote>
</body>
</html>