[BEEPwg] About beep output and input stream

Marshall Rose mrose@dbc.mtview.ca.us
Tue, 6 Aug 2002 12:52:32 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_0131_01C23D48.21667E60
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_0132_01C23D48.21667E60"


------=_NextPart_001_0132_01C23D48.21667E60
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Messagehi. please send your note to =
beepcore-java-users@lists.sourceforge.net... and maybe someone there can =
answer it.

/mtr
  ----- Original Message -----=20
  From: Russell Hung=20
  To: beepwg@lists.beepcore.org=20
  Sent: Tuesday, August 06, 2002 11:44 AM
  Subject: [BEEPwg] About beep output and input stream


  Hi,

  I have a question about the input and output stream of BEEP. I read =
the example on the book, "BEEP", written by Dr. Marshall T. Rose and =
published by O'Reilly. There is a client example on page 52:

  try {
      channel.sendMSG(new StringOutputDataStream(request), reply);
  } catch { ....}

  InputDataStream ds =3D reply.getNextReply().getDataStream();
  InputStream is =3D ds.getInputStream();

  while(is.read() !=3D -1) {
      ++replyLength;
  }=20

  It uses the message reply object to get the input stream. That means =
we have to send a message and wait for the response. This is not what I =
want. What I need are two independent threads: one for listening to the =
port/messages and one for sending out the message through the port. Is =
there any way to have an independent InputStream? Thanks.=20

  Best Regards,

  Russell Hung
  rhung@visionsolutions.com


------=_NextPart_001_0132_01C23D48.21667E60
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><TITLE id=3DridTitle>Message</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<STYLE>BODY {
	MARGIN-TOP: 25px; FONT-SIZE: 10pt; MARGIN-LEFT: 15px; COLOR: #993300; =
FONT-FAMILY: Arial, Helvetica
}
</STYLE>

<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR></HEAD>
<BODY id=3DridBody bgColor=3D#ffffff=20
background=3Dcid:013001c23d82$cdb79ac0$6500000a@dev0196>
<DIV><FONT color=3D#000000>hi. please send your note to <A=20
href=3D"mailto:beepcore-java-users@lists.sourceforge.net">beepcore-java-u=
sers@lists.sourceforge.net</A>...=20
and maybe someone there can answer it.</FONT></DIV>
<DIV><FONT color=3D#000000></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000>/mtr</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Drhung@visionsolutions.com=20
  href=3D"mailto:rhung@visionsolutions.com">Russell Hung</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dbeepwg@lists.beepcore.org=20
  =
href=3D"mailto:beepwg@lists.beepcore.org">beepwg@lists.beepcore.org</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, August 06, 2002 =
11:44=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [BEEPwg] About beep =
output and=20
  input stream</DIV>
  <DIV><BR></DIV>
  <DIV><SPAN class=3D632492218-06082002>Hi,</SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D632492218-06082002>I have a question about the =
input and=20
  output stream of&nbsp;BEEP. I read the example on the book, "BEEP",=20
  written&nbsp;by Dr. Marshall T. Rose and&nbsp;published by O'Reilly. =
There is=20
  a client&nbsp;example on page 52:</SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D632492218-06082002>try {</SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002>&nbsp;&nbsp;&nbsp; =
channel.sendMSG(new=20
  StringOutputDataStream(request), reply);</SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002>} catch { ....}</SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D632492218-06082002>InputDataStream ds =3D=20
  reply.getNextReply().getDataStream();</SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002>InputStream is =3D=20
  ds.getInputStream();</SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D632492218-06082002>while(is.read() !=3D -1) =
{</SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002>&nbsp;&nbsp;&nbsp;=20
  ++replyLength;</SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002>} </SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D632492218-06082002>It uses the message reply object =
to get=20
  the input stream. That means we have to send a message and wait for =
the=20
  response. This is not what I want. What I need&nbsp;are two =
independent=20
  threads: one&nbsp;for listening to the port/messages and one for =
sending out=20
  the message through the&nbsp;port. Is there any way to have an =
independent=20
  InputStream? Thanks. </SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D632492218-06082002>Best Regards,</SPAN></DIV>
  <DIV><SPAN class=3D632492218-06082002></SPAN>&nbsp;</DIV>
  <DIV align=3Dleft><FONT color=3D#8a315b>Russell Hung</FONT></DIV>
  <DIV align=3Dleft><FONT color=3D#7c0c7c><A=20
  =
href=3D"mailto:rhung@visionsolutions.com">rhung@visionsolutions.com</A></=
FONT></DIV>
  <DIV align=3Dleft>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_001_0132_01C23D48.21667E60--

------=_NextPart_000_0131_01C23D48.21667E60
Content-Type: image/jpeg;
	name="Leaves Bkgrd.jpg"
Content-Transfer-Encoding: base64
Content-ID: <013001c23d82$cdb79ac0$6500000a@dev0196>
Content-Location: Leaves%20Bkgrd.jpg

/9j/4AAQSkZJRgABAgEASABIAAD/7QZAUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA
AQBIAAAAAQABOEJJTQPzAAAAAAAIAAAAAAAAAAA4QklNBAoAAAAAAAEAADhCSU0nEAAAAAAACgAB
AAAAAAAAAAI4QklNA/UAAAAAAEgAL2ZmAAEAbGZmAAYAAAAAAAEAL2ZmAAEAoZmaAAYAAAAAAAEA
MgAAAAEAWgAAAAYAAAAAAAEANQAAAAEALQAAAAYAAAAAAAE4QklNA/gAAAAAAHAAAP//////////
//////////////////8D6AAAAAD/////////////////////////////A+gAAAAA////////////
/////////////////wPoAAAAAP////////////////////////////8D6AAAOEJJTQQIAAAAAAAQ
AAAAAQAAAkAAAAJAAAAAADhCSU0ECQAAAAAEzwAAAAEAAACAAAAAgAAAAYAAAMAAAAAEswAYAAH/
2P/gABBKRklGAAECAQBIAEgAAP/+ACdGaWxlIHdyaXR0ZW4gYnkgQWRvYmUgUGhvdG9zaG9wqCA0
LjAA/+4ADkFkb2JlAGSAAAAAAf/bAIQADAgICAkIDAkJDBELCgsRFQ8MDA8VGBMTFRMTGBEMDAwM
DAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAENCwsNDg0QDg4QFA4ODhQUDg4ODhQRDAwM
DAwREQwMDAwMDBEMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8AAEQgAgACAAwEiAAIRAQMR
Af/dAAQACP/EAT8AAAEFAQEBAQEBAAAAAAAAAAMAAQIEBQYHCAkKCwEAAQUBAQEBAQEAAAAAAAAA
AQACAwQFBgcICQoLEAABBAEDAgQCBQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIjJBVS
wWIzNHKC0UMHJZJT8OHxY3M1FqKygyZEk1RkRcKjdDYX0lXiZfKzhM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