Article View: borland.public.jbuilder.java.api
Article #1610Input & Output Streams causing blue screen of death?
From: Randy K. Secrist
Date: Tue, 06 Nov 2001 03:39
Date: Tue, 06 Nov 2001 03:39
70 lines
2897 bytes
2897 bytes
Help!
I am running a simple program that communicates with a server via an input
and output stream, but everytime I run it I am getting an NT bluescreen
refering to a DRIVER_IRQ_NOT_LESS_THAN_OR_EQUAL.
The java vm is running on a dual processor PC. I am Very confused because
the last time I tried this code it worked. (on a different PC). Could it
be some conflict with the dual processor?
Code is below...
Randy
public static void main(String[] args) {
// declaration section:
// smtpClient: our client socket
// os: output stream
// is: input stream
Socket smtpSocket = null;
DataOutputStream os = null;
BufferedReader is = null;
// Initialization section:
// Try to open a socket on smtp port 25
// Try to open input and output streams
try {
// Open Socket
smtpSocket = new Socket("someHost", 25);
os = new DataOutputStream(smtpSocket.getOutputStream());
is = new BufferedReader(new
InputStreamReader(smtpSocket.getInputStream()));
// Send Output
os.writeBytes("HELO\n");
os.writeBytes("MAIL From: someemail@somewhere.com\n");
os.writeBytes("RCPT To:someemail@somewhere.com\n");
os.writeBytes("DATA\n");
os.writeBytes(".\n");
os.writeBytes("From: someemail@somewhere.com\n");
os.writeBytes("Subject: testing socket program\n");
os.writeBytes("Hi there\n"); // message body
os.writeBytes("\n.\n");
os.writeBytes("QUIT");
// Get input:
StringBuffer input = new StringBuffer();
String line;
/*
while ((line = is.r != null) {
input.append(line + "\n");
if (line.equalsIgnoreCase("OK")) {
break;
}
}
*/
// Close all streams and socket.
os.close();
is.close();
smtpSocket.close();
System.out.println(input.toString());
}
catch (UnknownHostException e) {
System.err.println("Don't know about host: someHostName");
}
catch (IOException e) {
System.err.println("Couldn't get I/O for the connection to: hostname");
}
}
Technical Details
Message-ID:
<eYIF7.476$DN2.645708@news.uswest.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!feed.news.qwest.net!news.uswest.net.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,31e57a3ba170f0b8,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-11-05 19:39:55 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!feed.news.qwest.net!news.uswest.net.POSTED!not-for-mail From: "Randy K. Secrist" <randy@secristfamily.com> Newsgroups: borland.public.jbuilder.java.api Subject: Input & Output Streams causing blue screen of death? Lines: 72 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <eYIF7.476$DN2.645708@news.uswest.net> Date: Mon, 5 Nov 2001 20:39:55 -0700 NNTP-Posting-Host: 63.226.106.234 X-Trace: news.uswest.net 1005017994 63.226.106.234 (Mon, 05 Nov 2001 21:39:54 CST) NNTP-Posting-Date: Mon, 05 Nov 2001 21:39:54 CST