httpd_socket(3erl)

πŸ’– NAME πŸ’–

Welcome to the httpd_socket(3erl) Erlang module definition page, bestie! This module is all about communication utility functions to be used by the Erlang web server API programmer. πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this module gives the Erlang web server API module programmer utility functions for generic sockets communication. The appropriate communication mechanism is transparently used β€” that is, ip_comm or ssl. It’s giving β€œhandled for you” energy, no cap. ✨

🌈 EXPORTS 🌈

πŸ’… deliver(SocketType, Socket, Data) -> Result

Types:

SocketType = socket_type()
Socket = socket()
Data = io_list() | binary()
Result = socket_closed | void()

deliver/3 sends Data over Socket using the specified SocketType. Socket and SocketType are to be the socket and the socket_type from the mod record as defined in httpd.hrl. Literally the β€œsend the data” icon. πŸ’Œ

🫢 peername(SocketType,Socket) -> {Port,IPAddress}

Types:

SocketType = socket_type()
Socket = socket()
Port = integer()
IPAddress = string()

peername/2 returns the Port and IPAddress of the remote Socket. Lowkey useful when you need to know who’s on the other end. πŸ‘€

⭐ resolve() -> HostName

Types:

HostName = string()

resolve/0 returns the official HostName of the current host. Periodt. πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

httpd(3erl) β€” go read it for the bigger httpd lore, iykyk. πŸ¦‹


πŸ’– Cute sign-off: source/version is Ericsson AB, inets 8.3.1.2, on the httpd_socket(3erl) page β€” and the footer doesn’t print a date, bestie, so that’s the whole footer tea, fr fr. 🫢

πŸ“¦ where this page comes from