httpd_socket(3)
π httpd_socket β the Erlang Module Definition, bestie π
okay so this is httpd_socket(3), a page from the Erlang manual set, and it's literally just the communication utility functions that you, the Erlang web server API programmer, get to use. group chat for sockets, basically. π«Ά
πΈ NAME πΈ
httpd_socket β communication utility functions to be used by the Erlang web server API programmer.
β¨ DESCRIPTION β¨
So here's the vibe: this module hands the Erlang web server API module programmer a whole lil toolkit of utility functions for generic sockets communication. The way it works is that the appropriate communication mechanism gets used transparently β like, you don't have to think about it, it just picks the right one for you. And the two options are ip_comm or ssl. slay. π
See also β httpd
π₯ FUNCTIONS π₯
deliver(SocketType, Socket, Data) -> Result
when
SocketType :: httpd:socket_type(),
Socket :: inet:socket(),
Data :: iolist() | binary(),
Result :: ok | socket_closed.
deliver/3 sends Data over Socket using the specified SocketType. β¨
ngl the important bit here is: the Socket and SocketType you pass in are supposed to be the socket and the socket_type from the mod record as defined in httpd.hrl. like, that's the assignment, don't improvise. π
peername(SocketType, Socket) -> {Port, IpAdress}
when
SocketType :: httpd:socket_type(),
Socket :: inet:socket() | ssl:sslsocket(),
Port :: inet:port_number(),
IpAdress ::
inet:ip4_address() |
inet:ip6_address() |
string().
peername/2 returns the Port and IPAddress of the remote Socket. that's it, that's the whole function, and it ate. π
resolve() -> HostName
when HostName :: inet:hostname().
resolve/0 returns the official HostName of the current host. main character energy fr fr. π
heads up bestie: yes, the original spells it IpAdress in that one spot. we do not fix what is iconic. periodt. π
π SEE ALSO π
httpd
and that's the whole page!! written by Ericsson AB, from inets 9.7.2, and it's giving httpd_socket(3) energy from start to finish. bye bestie, go deliver some data ππ¦πΈ
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms