mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 12:04:39 +02:00
8221252: (sc) SocketChannel and its socket adaptor need to handle connection reset
Reviewed-by: bpb
This commit is contained in:
parent
cc590f5765
commit
3a4d5db248
13 changed files with 507 additions and 88 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -25,19 +25,16 @@
|
|||
|
||||
package sun.nio.ch;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Allows different platforms to call different native methods
|
||||
* for read and write operations.
|
||||
*/
|
||||
|
||||
class SocketDispatcher extends NativeDispatcher
|
||||
{
|
||||
|
||||
static {
|
||||
IOUtil.load();
|
||||
}
|
||||
class SocketDispatcher extends NativeDispatcher {
|
||||
SocketDispatcher() { }
|
||||
|
||||
int read(FileDescriptor fd, long address, int len) throws IOException {
|
||||
return read0(fd, address, len);
|
||||
|
@ -63,7 +60,8 @@ class SocketDispatcher extends NativeDispatcher
|
|||
close0(fd);
|
||||
}
|
||||
|
||||
//-- Native methods
|
||||
// -- Native methods --
|
||||
|
||||
static native int read0(FileDescriptor fd, long address, int len)
|
||||
throws IOException;
|
||||
|
||||
|
@ -79,4 +77,8 @@ class SocketDispatcher extends NativeDispatcher
|
|||
static native void preClose0(FileDescriptor fd) throws IOException;
|
||||
|
||||
static native void close0(FileDescriptor fd) throws IOException;
|
||||
|
||||
static {
|
||||
IOUtil.load();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue