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
28 package java.net;
29
30 import java.io.IOException;
31
32 @SuppressWarnings({"unchecked", "deprecation", "all"})
33 public abstract class SocketImpl implements java.net.SocketOptions {
34
SocketImpl()35 public SocketImpl() { throw new RuntimeException("Stub!"); }
36
create(boolean stream)37 protected abstract void create(boolean stream) throws java.io.IOException;
38
connect(java.lang.String host, int port)39 protected abstract void connect(java.lang.String host, int port) throws java.io.IOException;
40
connect(java.net.InetAddress address, int port)41 protected abstract void connect(java.net.InetAddress address, int port) throws java.io.IOException;
42
connect(java.net.SocketAddress address, int timeout)43 protected abstract void connect(java.net.SocketAddress address, int timeout) throws java.io.IOException;
44
bind(java.net.InetAddress host, int port)45 protected abstract void bind(java.net.InetAddress host, int port) throws java.io.IOException;
46
listen(int backlog)47 protected abstract void listen(int backlog) throws java.io.IOException;
48
accept(java.net.SocketImpl s)49 protected abstract void accept(java.net.SocketImpl s) throws java.io.IOException;
50
getInputStream()51 protected abstract java.io.InputStream getInputStream() throws java.io.IOException;
52
getOutputStream()53 protected abstract java.io.OutputStream getOutputStream() throws java.io.IOException;
54
available()55 protected abstract int available() throws java.io.IOException;
56
close()57 protected abstract void close() throws java.io.IOException;
58
shutdownInput()59 protected void shutdownInput() throws java.io.IOException { throw new RuntimeException("Stub!"); }
60
shutdownOutput()61 protected void shutdownOutput() throws java.io.IOException { throw new RuntimeException("Stub!"); }
62
getFileDescriptor()63 protected java.io.FileDescriptor getFileDescriptor() { throw new RuntimeException("Stub!"); }
64
65 @libcore.api.CorePlatformApi
getFD$()66 public java.io.FileDescriptor getFD$() { throw new RuntimeException("Stub!"); }
67
getInetAddress()68 protected java.net.InetAddress getInetAddress() { throw new RuntimeException("Stub!"); }
69
getPort()70 protected int getPort() { throw new RuntimeException("Stub!"); }
71
supportsUrgentData()72 protected boolean supportsUrgentData() { throw new RuntimeException("Stub!"); }
73
sendUrgentData(int data)74 protected abstract void sendUrgentData(int data) throws java.io.IOException;
75
getLocalPort()76 protected int getLocalPort() { throw new RuntimeException("Stub!"); }
77
toString()78 public java.lang.String toString() { throw new RuntimeException("Stub!"); }
79
setPerformancePreferences(int connectionTime, int latency, int bandwidth)80 protected void setPerformancePreferences(int connectionTime, int latency, int bandwidth) { throw new RuntimeException("Stub!"); }
81
82 protected java.net.InetAddress address;
83
84 protected java.io.FileDescriptor fd;
85
86 protected int localport;
87
88 protected int port;
89 }
90
91