द्वारा कनेक्शन जबरन बंद कर दिया गया था मेरे पास एक java.nio.channels.SocketChannel है जो मेरे जेएससीएसआई इम्प्लामेंटेशन में है जो डिस्कवर कनेक्ट हो रहा है जब मैं 4 जीबी से अधिक आकार वाले ड्राइवर को खोलने का प्रयास करता हूं। आईएससीआई आरएफसी का कहना है कि BasicHeaderSegment.BHS_FIXED_SIZE 48 हो सकता है, इसलिए इस स्थिति के साथ मैं चैनल पर बाइट्स पढ़ सकता हूं। जावा दस्तावेज़ 5 प्रकार की त्रुटियों का कहना है, लेकिन मेरा ऐप आखिरी एक फेंक रहा है जो एक विशिष्ट जानकारी नहीं कहता है। 1 - NotYetConnectedException 2 - ClosedChannelException 3 - AsynchronousCloseException 4 - ClosedByInterruptException 5 - IOExceptionरिमोट होस्ट
public final int read(final SocketChannel sChannel) throws InternetSCSIException, IOException, DigestException {
// read Basic Header Segment first to determine the total length of this
// Protocol Data Unit.
clear();
final ByteBuffer bhs = ByteBuffer.allocate(BasicHeaderSegment.BHS_FIXED_SIZE);
int len = 0;
while (len < BasicHeaderSegment.BHS_FIXED_SIZE) {
int lens = sChannel.read(bhs);
if (lens == -1) {
// The Channel was closed at the Target (e.g. the Target does
// not support Multiple Connections)
// throw new ClosedChannelException();
return lens;
}
len += lens;
LOGGER.trace("Receiving through SocketChannel: " + len + " of maximal " + BasicHeaderSegment.BHS_FIXED_SIZE);
}
bhs.flip();
त्रुटि:
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
at org.jscsi.parser.ProtocolDataUnit.read(ProtocolDataUnit.java:417)
at org.jscsi.target.connection.TargetSenderWorker.receiveFromWire(TargetSenderWorker.java:145)
at org.jscsi.target.connection.Connection$TargetConnection.receivePdu(Connection.java:217)
at org.jscsi.target.connection.phase.TargetFullFeaturePhase.execute(TargetFullFeaturePhase.java:96)
at org.jscsi.target.connection.Connection$TargetConnection.call(Connection.java:264)
at org.jscsi.target.connection.Connection$TargetConnection.call(Connection.java:79)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[pool-9-thread-1] INFO org.jscsi.target.connection
अग्रिम धन्यवाद, फेलिप
अपने शीर्षक में सुधार नोट करें। आपका सॉकेट चैनल अभी भी खुला है। यह * कनेक्शन * है जिसे जबरन बंद कर दिया गया था। – EJP