src/java.base/share/classes/sun/net/PlatformSocketImpl.java
author michaelm
Mon, 11 Feb 2019 15:17:31 +0000
branchniosocketimpl-branch
changeset 57176 726630bc6a4c
parent 57174 src/java.base/share/classes/sun/net/TrustedSocketImpl.java@899641440751
child 57178 738431fa8fb2
permissions -rw-r--r--
Cleanup
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57174
899641440751 More cleanup
alanb
parents:
diff changeset
     1
/*
899641440751 More cleanup
alanb
parents:
diff changeset
     2
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
899641440751 More cleanup
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
899641440751 More cleanup
alanb
parents:
diff changeset
     4
 *
899641440751 More cleanup
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
899641440751 More cleanup
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
899641440751 More cleanup
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
899641440751 More cleanup
alanb
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
899641440751 More cleanup
alanb
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
899641440751 More cleanup
alanb
parents:
diff changeset
    10
 *
899641440751 More cleanup
alanb
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
899641440751 More cleanup
alanb
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
899641440751 More cleanup
alanb
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
899641440751 More cleanup
alanb
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
899641440751 More cleanup
alanb
parents:
diff changeset
    15
 * accompanied this code).
899641440751 More cleanup
alanb
parents:
diff changeset
    16
 *
899641440751 More cleanup
alanb
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
899641440751 More cleanup
alanb
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
899641440751 More cleanup
alanb
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
899641440751 More cleanup
alanb
parents:
diff changeset
    20
 *
899641440751 More cleanup
alanb
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
899641440751 More cleanup
alanb
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
899641440751 More cleanup
alanb
parents:
diff changeset
    23
 * questions.
899641440751 More cleanup
alanb
parents:
diff changeset
    24
 */
899641440751 More cleanup
alanb
parents:
diff changeset
    25
package sun.net;
899641440751 More cleanup
alanb
parents:
diff changeset
    26
899641440751 More cleanup
alanb
parents:
diff changeset
    27
import java.io.IOException;
899641440751 More cleanup
alanb
parents:
diff changeset
    28
import java.net.SocketImpl;
899641440751 More cleanup
alanb
parents:
diff changeset
    29
899641440751 More cleanup
alanb
parents:
diff changeset
    30
/**
899641440751 More cleanup
alanb
parents:
diff changeset
    31
 * Implemented by the platform's SocketImpl implementations.
899641440751 More cleanup
alanb
parents:
diff changeset
    32
 */
899641440751 More cleanup
alanb
parents:
diff changeset
    33
57176
726630bc6a4c Cleanup
michaelm
parents: 57174
diff changeset
    34
public interface PlatformSocketImpl {
57174
899641440751 More cleanup
alanb
parents:
diff changeset
    35
899641440751 More cleanup
alanb
parents:
diff changeset
    36
    /**
899641440751 More cleanup
alanb
parents:
diff changeset
    37
     * Creates a new instance of this SocketImpl.
899641440751 More cleanup
alanb
parents:
diff changeset
    38
     */
57176
726630bc6a4c Cleanup
michaelm
parents: 57174
diff changeset
    39
    <S extends SocketImpl & PlatformSocketImpl> S newInstance(boolean server);
57174
899641440751 More cleanup
alanb
parents:
diff changeset
    40
899641440751 More cleanup
alanb
parents:
diff changeset
    41
    /**
899641440751 More cleanup
alanb
parents:
diff changeset
    42
     * Invoked by ServerSocket to fix up the SocketImpl state after a connection
899641440751 More cleanup
alanb
parents:
diff changeset
    43
     * is accepted by a custom SocketImpl
899641440751 More cleanup
alanb
parents:
diff changeset
    44
     */
899641440751 More cleanup
alanb
parents:
diff changeset
    45
    void postCustomAccept() throws IOException;
899641440751 More cleanup
alanb
parents:
diff changeset
    46
899641440751 More cleanup
alanb
parents:
diff changeset
    47
    /**
899641440751 More cleanup
alanb
parents:
diff changeset
    48
     * Copy the state from this connected SocketImpl to a target SocketImpl. If
899641440751 More cleanup
alanb
parents:
diff changeset
    49
     * the target SocketImpl is not a newly created SocketImpl then it is first
899641440751 More cleanup
alanb
parents:
diff changeset
    50
     * closed to release any resources. The target SocketImpl becomes the owner
899641440751 More cleanup
alanb
parents:
diff changeset
    51
     * of the file descriptor, this SocketImpl is marked as closed and should
899641440751 More cleanup
alanb
parents:
diff changeset
    52
     * be discarded.
899641440751 More cleanup
alanb
parents:
diff changeset
    53
     */
899641440751 More cleanup
alanb
parents:
diff changeset
    54
    void copyTo(SocketImpl si);
899641440751 More cleanup
alanb
parents:
diff changeset
    55
}