[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Q] How to do Simple Port-Based Input-Process-Output?



This is a multi-part message in MIME format.

------=_NextPart_000_03AE_01C18ED8.81C3FDB0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Schemers,

I'm new to Scheme, and I'm excited about using it for some =
graph-theoretic processing. =20

Assuming that I want to do the processing portion of the following =
sequence in Scheme, is there a standard idiom for doing the I/O portion =
of sequence in Scheme also?  Or should I interface to external I/O =
mechanisms in some kind of library (C language maybe?) ?

Input:
1. Listen forever on an arbitrary port number (socket-based).
2. Read and enqueue a message that is structured in a predefined way =
(say, as a graph), into a process-specific queue.
3. Keep listening.

Processing:
1. Dequeue inbound message (e.g., a graph).
2. Perform arbitrary graph-theoretic processing, including decoding the =
message structure as necessary.
3. Generate appropriate outbound message, structuring it as necessary.
4. Enqueue outbound message (signal output process if needed).

Output:
1.  Wait forever for outbound messages to be enqueued.
2.  Dequeue outbound message.
3.  Send outbound message to arbitrary (process-specific) downstream IP =
address and port.

Thanks in advance for any help or advice you can provide.

Dave Duchesneau
dave@scrutiny.com

------=_NextPart_000_03AE_01C18ED8.81C3FDB0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4807.2300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Schemers,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm new to Scheme, and I'm excited =
about using it=20
for some graph-theoretic processing.&nbsp; </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Assuming that I want to do the =
processing portion=20
of the following sequence in Scheme, is there a standard idiom for doing =
the I/O=20
portion of sequence in Scheme also?&nbsp; Or should I interface =
to&nbsp;external=20
I/O mechanisms in some kind of library (C language maybe?) =
?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Input:</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>1. Listen forever on an arbitrary =
port&nbsp;number=20
(socket-based).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2. Read and enqueue a&nbsp;message that =
is=20
structured in a predefined way (say, as a&nbsp;graph), into a =
process-specific=20
queue.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>3. Keep listening.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2><STRONG>Processing:</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>1. Dequeue inbound&nbsp;message (e.g., =
a=20
graph).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2. Perform arbitrary graph-theoretic =
processing,=20
including decoding the message structure as necessary.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>3.&nbsp;Generate appropriate outbound =
message,=20
structuring it as necessary.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>4. Enqueue outbound message (signal =
output process=20
if needed).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Output:</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>1.&nbsp; Wait forever for outbound =
messages to be=20
enqueued.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2.&nbsp; Dequeue outbound =
message.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>3.&nbsp; Send outbound message to =
arbitrary=20
(process-specific) downstream IP address and port.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance for any help or =
advice you can=20
provide.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Dave Duchesneau</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"mailto:dave@scrutiny.com";>dave@scrutiny.com</A></FONT></DIV></BOD=
Y></HTML>

------=_NextPart_000_03AE_01C18ED8.81C3FDB0--