summaryrefslogtreecommitdiffhomepage
path: root/plop.c
diff options
context:
space:
mode:
Diffstat (limited to 'plop.c')
-rw-r--r--plop.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/plop.c b/plop.c
index c0f9919..eb27125 100644
--- a/plop.c
+++ b/plop.c
@@ -4,6 +4,12 @@
#include <sys/types.h>
#include <unistd.h>
+/// Tries to create, bind and start listening on INET server socket.
+/// \param node Hostname
+/// \param service Port
+/// \return File descriptor of the socket or -1 in case of an error
+/// \see getaddrinfo(3)
+// TODO: Handle UNIX sockets
int make_server(const char * node, const char * service)
{
struct addrinfo hints = {
@@ -50,6 +56,10 @@ int make_server(const char * node, const char * service)
return server;
}
+/// Standard entry point for the program.
+/// \param argc Argument count
+/// \param argv Argument array
+/// \return Error code
int main(int argc, char ** argv)
{
if (2 != argc)