1
<?xml version="1.0" encoding="latin1" ?>
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
7
<year>1997</year><year>2009</year>
8
<holder>Ericsson AB. All Rights Reserved.</holder>
11
The contents of this file are subject to the Erlang Public License,
12
Version 1.1, (the "License"); you may not use this file except in
13
compliance with the License. You should have received a copy of the
14
Erlang Public License along with this software. If not, it can be
15
retrieved online at http://www.erlang.org/.
17
Software distributed under the License is distributed on an "AS IS"
18
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
19
the License for the specific language governing rights and limitations
24
<title>httpd_socket</title>
25
<prepared>Joakim Grebenö</prepared>
27
<date>1997-10-14</date>
29
<file>httpd_socket.sgml</file>
31
<module>httpd_socket</module>
32
<modulesummary>Communication utility functions to be used by the Erlang
33
Web server API programmer.</modulesummary>
35
<p>This module provides the Erlang Web server API module programmer
36
with utility functions for generic sockets communication. The
37
appropriate communication mechanism is transparently used, that
38
is <c>ip_comm</c> or <c>ssl</c>.</p>
42
<name>deliver(SocketType, Socket, Data) -> Result</name>
43
<fsummary>Send binary data over socket.</fsummary>
45
<v>SocketType = socket_type()</v>
46
<v>Socket = socket()</v>
47
<v>Data = io_list() | binary()</v>
48
<v>Result = socket_closed | void()</v>
51
<marker id="deliver"></marker>
52
<p><c>deliver/3</c> sends the <c>Binary</c> over the
53
<c>Socket</c> using the specified <c>SocketType</c>. Socket
54
and SocketType should be the socket and the socket_type form
55
the mod record as defined in httpd.hrl</p>
59
<name>peername(SocketType,Socket) -> {Port,IPAddress}</name>
60
<fsummary>Return the port and IP-address of the remote socket.</fsummary>
62
<v>SocketType = socket_type()</v>
63
<v>Socket = socket()</v>
64
<v>Port = integer()</v>
65
<v>IPAddress = string()</v>
68
<marker id="peername"></marker>
69
<p><c>peername/3</c> returns the <c>Port</c> and
70
<c>IPAddress</c> of the remote <c>Socket</c>. </p>
74
<name>resolve() -> HostName</name>
75
<fsummary>Return the official name of the current host.</fsummary>
77
<v>HostName = string()</v>
80
<marker id="resolve"></marker>
81
<p><c>resolve/0</c> returns the official <c>HostName</c> of
82
the current host. </p>
88
<marker id="see_also"></marker>
89
<title>SEE ALSO</title>
90
<p><seealso marker="httpd">httpd(3)</seealso></p>