pike.git / src / modules / _Stdio / socket.c

version» Context lines:

pike.git/src/modules/_Stdio/socket.c:497:   /*! @decl void create(int|string port, void|function accept_callback, @    *! void|string ip)    *! @decl void create("stdin", void|function accept_callback)    *!    *! When called with an int or any string except @expr{"stdin"@} as    *! first argument, this function does the same as @[bind()] would do    *! with the same arguments.    *!    *! When called with @expr{"stdin"@} as argument, a socket is created    *! out of the file descriptor 0. This is only useful if that actually -  *! IS a socket to begin with. +  *! IS a socket to begin with, and is equivalent to creating a port and +  *! initializing it with @[listen_fd](0).    *!    *! @seealso    *! @[bind], @[listen_fd]    */   static void port_create(INT32 args)   {    if(args)    {    if(TYPEOF(Pike_sp[-args]) == PIKE_T_INT ||    (TYPEOF(Pike_sp[-args]) == PIKE_T_STRING &&