home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / programm / 4580 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  8.0 KB

  1. Path: sparky!uunet!decwrl!csus.edu!nic.csu.net!opus!vpopesc
  2. Newsgroups: comp.unix.programmer
  3. Subject: writing servers
  4. Message-ID: <1992Sep8.230315.2621@nic.csu.net>
  5. From: vpopesc@opus.uucp (Gov. Wilson Sucks)
  6. Date: 8 Sep 92 23:03:13 PDT
  7. Distribution: usa
  8. Organization: California State University, Lost Angels
  9. Nntp-Posting-Host: opus.calstatela.edu
  10. Lines: 213
  11.  
  12. [Hope this doesn't go out in multiplicate. Having posting problems]
  13.  
  14.  
  15. Hiya,
  16.  
  17. I have a few questions relating toa project I'm doing. First, the
  18. project:
  19.  
  20.  I would like to write a "server" (daemon?) that would process a
  21.  number of connections (internet) using sockets.. (inet,stream)
  22.  I.e. telnet [host] [port]. The server should process all connections,
  23.  and not fork itself for each connection. Just one server, x clients.
  24.  This is SunOS 4.1.2, but I would like it to be portable. This would
  25.  be like ftp, or ircd.. More like ircd tho, since ftpd is
  26.  one server per client.
  27.  
  28. I have encountered the following problem tho:
  29.  
  30.  How can I detect if there is activity for the server to process? I
  31.  would like it to be idle as long as it has nothing to do. But all
  32.  I could do was to put it in an infinite loop. And that made it
  33.  eat up 80% cpu, which is prolly unacceptable.
  34.  
  35. So.. I am appealing to net benevolence for:
  36.  
  37.  1. Code? Anyone has a small such server that I could follow? I would
  38.     like to write this properly, no hacks. Or, can someone write
  39.     me a quick flowchart on how it should go? Little hints? Do's
  40.     and don'ts? I want it to come out sleek and as efficient as
  41.     possible. I do have experience with Unix programming, I am not a
  42.     total moron, so you don't need to babytalk me. ;) Like I 
  43.     mentioned, I did such a program already, it just wasn't pleased
  44.     with it. (although it worked). If you send code, I promise I'll
  45.     write my own, and not leech your code and call it my own! :)
  46.  
  47.  
  48.  2. Can anyone suggest literature on the subject. All I could find was
  49.     books that examined the functions taken apart. How about one that
  50.     says "Ok, here's what goes into writteing a server" ? 
  51.  
  52. Hope this is clear. I tried to make it as clear as possible without
  53. sounding like a moron. ;)
  54.  
  55. Thanks.
  56.  
  57.  
  58.  
  59.  
  60. Newsgroups: comp.unix.programmer
  61. Subject: Writting unix servers
  62. Summary: 
  63. Expires: 
  64. Sender: 
  65. Followup-To: 
  66. Distribution: net
  67. Organization: California State University, Lost Angels
  68. Keywords: 
  69.  
  70. Hiya,
  71.  
  72. I have a few questions relating toa project I'm doing. First, the
  73. project:
  74.  
  75.  I would like to write a "server" (daemon?) that would process a
  76.  number of connections (internet) using sockets.. (inet,stream)
  77.  I.e. telnet [host] [port]. The server should process all connections,
  78.  and not fork itself for each connection. Just one server, x clients.
  79.  This is SunOS 4.1.2, but I would like it to be portable. This would
  80.  be like ftp, or ircd.. More like ircd tho, since ftpd is
  81.  one server per client.
  82.  
  83. I have encountered the following problem tho:
  84.  
  85.  How can I detect if there is activity for the server to process? I
  86.  would like it to be idle as long as it has nothing to do. But all
  87.  I could do was to put it in an infinite loop. And that made it
  88.  eat up 80% cpu, which is prolly unacceptable.
  89.  
  90. So.. I am appealing to net benevolence for:
  91.  
  92.  1. Code? Anyone has a small such server that I could follow? I would
  93.     like to write this properly, no hacks. Or, can someone write
  94.     me a quick flowchart on how it should go? Little hints? Do's
  95.     and don'ts? I want it to come out sleek and as efficient as
  96.     possible. I do have experience with Unix programming, I am not a
  97.     total moron, so you don't need to babytalk me. ;) Like I 
  98.     mentioned, I did such a program already, it just wasn't pleased
  99.     with it. (although it worked). If you send code, I promise I'll
  100.     write my own, and not leech your code and call it my own! :)
  101.  
  102.  
  103.  2. Can anyone suggest literature on the subject. All I could find was
  104.     books that examined the functions taken apart. How about one that
  105.     says "Ok, here's what goes into writteing a server" ? 
  106.  
  107. Hope this is clear. I tried to make it as clear as possible without
  108. sounding like a moron. ;)
  109.  
  110. Thanks.
  111.  
  112. Newsgroups: comp.unix.programmer
  113. Subject: Writting unix servers
  114. Summary: 
  115. Expires: 
  116. Sender: 
  117. Followup-To: 
  118. Distribution: net
  119. Organization: California State University, Lost Angels
  120. Keywords: 
  121.  
  122. Hiya,
  123.  
  124. I have a few questions relating toa project I'm doing. First, the
  125. project:
  126.  
  127.  I would like to write a "server" (daemon?) that would process a
  128.  number of connections (internet) using sockets.. (inet,stream)
  129.  I.e. telnet [host] [port]. The server should process all connections,
  130.  and not fork itself for each connection. Just one server, x clients.
  131.  This is SunOS 4.1.2, but I would like it to be portable. This would
  132.  be like ftp, or ircd.. More like ircd tho, since ftpd is
  133.  one server per client.
  134.  
  135. I have encountered the following problem tho:
  136.  
  137.  How can I detect if there is activity for the server to process? I
  138.  would like it to be idle as long as it has nothing to do. But all
  139.  I could do was to put it in an infinite loop. And that made it
  140.  eat up 80% cpu, which is prolly unacceptable.
  141.  
  142. So.. I am appealing to net benevolence for:
  143.  
  144.  1. Code? Anyone has a small such server that I could follow? I would
  145.     like to write this properly, no hacks. Or, can someone write
  146.     me a quick flowchart on how it should go? Little hints? Do's
  147.     and don'ts? I want it to come out sleek and as efficient as
  148.     possible. I do have experience with Unix programming, I am not a
  149.     total moron, so you don't need to babytalk me. ;) Like I 
  150.     mentioned, I did such a program already, it just wasn't pleased
  151.     with it. (although it worked). If you send code, I promise I'll
  152.     write my own, and not leech your code and call it my own! :)
  153.  
  154.  
  155.  2. Can anyone suggest literature on the subject. All I could find was
  156.     books that examined the functions taken apart. How about one that
  157.     says "Ok, here's what goes into writteing a server" ? 
  158.  
  159. Hope this is clear. I tried to make it as clear as possible without
  160. sounding like a moron. ;)
  161.  
  162. Thanks.
  163.  
  164.  
  165.  
  166.  
  167. Newsgroups: comp.unix.programmer
  168. Subject: Writting unix servers
  169. Summary: 
  170. Expires: 
  171. Sender: 
  172. Followup-To: 
  173. Distribution: net
  174. Organization: California State University, Lost Angels
  175. Keywords: 
  176.  
  177. Hiya,
  178.  
  179. I have a few questions relating toa project I'm doing. First, the
  180. project:
  181.  
  182.  I would like to write a "server" (daemon?) that would process a
  183.  number of connections (internet) using sockets.. (inet,stream)
  184.  I.e. telnet [host] [port]. The server should process all connections,
  185.  and not fork itself for each connection. Just one server, x clients.
  186.  This is SunOS 4.1.2, but I would like it to be portable. This would
  187.  be like ftp, or ircd.. More like ircd tho, since ftpd is
  188.  one server per client.
  189.  
  190. I have encountered the following problem tho:
  191.  
  192.  How can I detect if there is activity for the server to process? I
  193.  would like it to be idle as long as it has nothing to do. But all
  194.  I could do was to put it in an infinite loop. And that made it
  195.  eat up 80% cpu, which is prolly unacceptable.
  196.  
  197. So.. I am appealing to net benevolence for:
  198.  
  199.  1. Code? Anyone has a small such server that I could follow? I would
  200.     like to write this properly, no hacks. Or, can someone write
  201.     me a quick flowchart on how it should go? Little hints? Do's
  202.     and don'ts? I want it to come out sleek and as efficient as
  203.     possible. I do have experience with Unix programming, I am not a
  204.     total moron, so you don't need to babytalk me. ;) Like I 
  205.     mentioned, I did such a program already, it just wasn't pleased
  206.     with it. (although it worked). If you send code, I promise I'll
  207.     write my own, and not leech your code and call it my own! :)
  208.  
  209.  
  210.  2. Can anyone suggest literature on the subject. All I could find was
  211.     books that examined the functions taken apart. How about one that
  212.     says "Ok, here's what goes into writteing a server" ? 
  213.  
  214. Hope this is clear. I tried to make it as clear as possible without
  215. sounding like a moron. ;)
  216.  
  217. Thanks.
  218.  
  219.  
  220. -- 
  221. _____________     __      ____________ 
  222. \_____      /    /_ \     \     _____/ Valentin Popescu
  223.  \_____     \_____/  \____/     ____/  <vpopesc@opus.calstatela.edu>
  224.   \______________      ____________/   P.O. Box 421181
  225.