Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

UPD Logging Server

 [1/2] from: rsnell::webtrends::com at: 12-Dec-2000 10:30


I have been using a TCP logging server for some stuff here at work for a couple of months now. Works fine with the latest Core experimental. It just waits for line data from a client and displays it when received (code below). Now I want to change to UDP instead of TCP. Unfortunately it doesn't appear to be just a simple change of protocol since I'm getting error messages when trying to use first and pick on the port. And more unfortunately, there is little UDP documentation from RT (at least that I can find). Here is the TCP version - what do I need to do for a UDP version? REBOL [] sp: open/lines/no-wait/with tcp://:5599 form newline forever [ cp: first wait sp d: "none" forever [ w: wait [cp .1] if all [port? w none? d][ ;connection closed - wait for a new one and continue cp: first wait sp d: "none" ] if port? w [ print d: pick cp 1 ] ] ] Thanks, Rodney

 [2/2] from: holger:rebol at: 12-Dec-2000 11:55


On Tue, Dec 12, 2000 at 10:30:57AM -0800, Rodney Snell wrote:
> I have been using a TCP logging server for some stuff > here at work for a couple of months now. Works fine with
<<quoted lines omitted: 6>>
> from RT (at least that I can find). > Here is the TCP version - what do I need to do for a UDP version?
Change sp: open/lines/no-wait/with tcp://:5599 form newline to sp: open/direct/no-wait udp://:5599 and do all port i/o directly on the main port (sp). UDP does not create subports for each incoming packet, i.e. you do not need the "cp: first wait sp" any more. -- Holger Kruse [holger--rebol--com]

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted