#!mkcmd # $Id: util_server.m,v 8.8 2012/08/30 14:42:41 ksb Exp $ # # This is the server side for the standard socket program. (ksb) # We open a INET socket, bind to a service/protocol, # the fd the application programmer declares just needs a # visible "SOCK_DESCR" structure and these 5 attributes: # key 2 { # the pointer to default address name SOCK_DESCR # '":telnet/tcp"' '"%qL"' "& SDf" # } # before '%K/ef;' # update '%K/ef;' # after '%n = %K/ef;' # # We can make the SOCK_DESCR structure with this C fragment: #%c #SOCK_DESCR SDf; #%% # # If the SOCK_DESCR structure has an initial value you like, you # do not need the before attribute at all. #SOCK_DESCR SDf = { "", "8080" , "tcp" } ; # from '' from '' from '' from '' from '' require "util_socket.m" "util_server.mc" key "SockBind" 2 initializer { "SockBind" "%ZK3ev" "%ZK2ev" }