1 /* 2 * Copyright (C) 2014 The Android Open Source Project 3 * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 * 6 * This code is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License version 2 only, as 8 * published by the Free Software Foundation. Oracle designates this 9 * particular file as subject to the "Classpath" exception as provided 10 * by Oracle in the LICENSE file that accompanied this code. 11 * 12 * This code is distributed in the hope that it will be useful, but WITHOUT 13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 * version 2 for more details (a copy is included in the LICENSE file that 16 * accompanied this code). 17 * 18 * You should have received a copy of the GNU General Public License version 19 * 2 along with this work; if not, write to the Free Software Foundation, 20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 21 * 22 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 23 * or visit www.oracle.com if you need additional information or have any 24 * questions. 25 */ 26 27 package java.net; 28 29 import android.compat.annotation.UnsupportedAppUsage; 30 31 @SuppressWarnings({"unchecked", "deprecation", "all"}) 32 public abstract class SocketImpl implements java.net.SocketOptions { 33 SocketImpl()34 public SocketImpl() { 35 throw new RuntimeException("Stub!"); 36 } 37 create(boolean stream)38 protected abstract void create(boolean stream) throws java.io.IOException; 39 connect(java.lang.String host, int port)40 protected abstract void connect(java.lang.String host, int port) throws java.io.IOException; 41 connect(java.net.InetAddress address, int port)42 protected abstract void connect(java.net.InetAddress address, int port) 43 throws java.io.IOException; 44 connect(java.net.SocketAddress address, int timeout)45 protected abstract void connect(java.net.SocketAddress address, int timeout) 46 throws java.io.IOException; 47 bind(java.net.InetAddress host, int port)48 protected abstract void bind(java.net.InetAddress host, int port) throws java.io.IOException; 49 listen(int backlog)50 protected abstract void listen(int backlog) throws java.io.IOException; 51 accept(java.net.SocketImpl s)52 protected abstract void accept(java.net.SocketImpl s) throws java.io.IOException; 53 getInputStream()54 protected abstract java.io.InputStream getInputStream() throws java.io.IOException; 55 getOutputStream()56 protected abstract java.io.OutputStream getOutputStream() throws java.io.IOException; 57 available()58 protected abstract int available() throws java.io.IOException; 59 close()60 protected abstract void close() throws java.io.IOException; 61 shutdownInput()62 protected void shutdownInput() throws java.io.IOException { 63 throw new RuntimeException("Stub!"); 64 } 65 shutdownOutput()66 protected void shutdownOutput() throws java.io.IOException { 67 throw new RuntimeException("Stub!"); 68 } 69 getFileDescriptor()70 protected java.io.FileDescriptor getFileDescriptor() { 71 throw new RuntimeException("Stub!"); 72 } 73 getFD$()74 public java.io.FileDescriptor getFD$() { 75 throw new RuntimeException("Stub!"); 76 } 77 getInetAddress()78 protected java.net.InetAddress getInetAddress() { 79 throw new RuntimeException("Stub!"); 80 } 81 getPort()82 protected int getPort() { 83 throw new RuntimeException("Stub!"); 84 } 85 supportsUrgentData()86 protected boolean supportsUrgentData() { 87 throw new RuntimeException("Stub!"); 88 } 89 sendUrgentData(int data)90 protected abstract void sendUrgentData(int data) throws java.io.IOException; 91 getLocalPort()92 protected int getLocalPort() { 93 throw new RuntimeException("Stub!"); 94 } 95 setSocket(java.net.Socket soc)96 void setSocket(java.net.Socket soc) { 97 throw new RuntimeException("Stub!"); 98 } 99 getSocket()100 java.net.Socket getSocket() { 101 throw new RuntimeException("Stub!"); 102 } 103 setServerSocket(java.net.ServerSocket soc)104 void setServerSocket(java.net.ServerSocket soc) { 105 throw new RuntimeException("Stub!"); 106 } 107 getServerSocket()108 java.net.ServerSocket getServerSocket() { 109 throw new RuntimeException("Stub!"); 110 } 111 toString()112 public java.lang.String toString() { 113 throw new RuntimeException("Stub!"); 114 } 115 reset()116 void reset() throws java.io.IOException { 117 throw new RuntimeException("Stub!"); 118 } 119 setPerformancePreferences(int connectionTime, int latency, int bandwidth)120 protected void setPerformancePreferences(int connectionTime, int latency, int bandwidth) { 121 throw new RuntimeException("Stub!"); 122 } 123 setOption(java.net.SocketOption<T> name, T value)124 <T> void setOption(java.net.SocketOption<T> name, T value) throws java.io.IOException { 125 throw new RuntimeException("Stub!"); 126 } 127 getOption(java.net.SocketOption<T> name)128 <T> T getOption(java.net.SocketOption<T> name) throws java.io.IOException { 129 throw new RuntimeException("Stub!"); 130 } 131 132 protected java.net.InetAddress address; 133 134 protected java.io.FileDescriptor fd; 135 136 protected int localport; 137 138 protected int port; 139 140 @UnsupportedAppUsage 141 java.net.ServerSocket serverSocket; 142 143 @UnsupportedAppUsage 144 java.net.Socket socket; 145 } 146