|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--java.net.SocketImpl
抽象クラス SocketImpl
は、ソケットを実際に実装するすべてのクラスに共通のスーパークラスです。クライアントソケットとサーバソケットの両方を作成する際に使用されます。
「プレーンな」ソケットは、各メソッドを記述のとおりに実装します。ファイアウォールやプロキシは使用しません。
フィールドの概要 | |
protected InetAddress |
address
このソケットのリモート側の IP アドレスです。 |
protected FileDescriptor |
fd
このソケットのファイル記述子オブジェクトです。 |
protected int |
localport
このソケットの接続先のローカルポート番号です。 |
protected int |
port
このソケットの接続先のリモートホスト上にあるポート番号です。 |
コンストラクタの概要 | |
SocketImpl()
|
メソッドの概要 | |
protected abstract void |
accept(SocketImpl s)
接続を受け入れます。 |
protected abstract int |
available()
このソケットからブロックなしで読み込めるバイト数を返します。 |
protected abstract void |
bind(InetAddress host,
int port)
指定されたホスト上の指定されたポート番号にこのソケットをバインドします。 |
protected abstract void |
close()
このソケットを閉じます。 |
protected abstract void |
connect(InetAddress address,
int port)
指定されたホスト上の指定されたポートにこのソケットを接続します。 |
protected abstract void |
connect(String host,
int port)
指定されたホスト上の指定されたポートにこのソケットを接続します。 |
protected abstract void |
create(boolean stream)
ストリームソケットまたはデータグラムソケットを作成します。 |
protected FileDescriptor |
getFileDescriptor()
このソケットの fd フィールド値を返します。 |
protected InetAddress |
getInetAddress()
このソケットの address フィールド値を返します。 |
protected abstract InputStream |
getInputStream()
このソケットの入力ストリームを返します。 |
protected int |
getLocalPort()
このソケットの localport フィールド値を返します。 |
protected abstract OutputStream |
getOutputStream()
このソケットの出力ストリームを返します。 |
protected int |
getPort()
このソケットの port フィールド値を返します。 |
protected abstract void |
listen(int backlog)
受信する接続 (接続要求) を入れる待ち行列の最大長を、 count 引数の値に設定します。 |
String |
toString()
このソケットのアドレスとポートを String として返します。 |
クラス java.lang.Object から継承したメソッド |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
フィールドの詳細 |
protected FileDescriptor fd
protected InetAddress address
protected int port
protected int localport
コンストラクタの詳細 |
public SocketImpl()
メソッドの詳細 |
protected abstract void create(boolean stream) throws IOException
stream
- true
を指定した場合はストリームソケットが作成され、そうでない場合はデータグラムソケットが作成されるprotected abstract void connect(String host, int port) throws IOException
host
- リモートホスト名port
- ポート番号protected abstract void connect(InetAddress address, int port) throws IOException
address
- リモートホストの IP アドレスport
- ポート番号protected abstract void bind(InetAddress host, int port) throws IOException
host
- リモートホストの IP アドレスport
- ポート番号protected abstract void listen(int backlog) throws IOException
count
引数の値に設定します。待ち行列が埋まっているときに接続要求があると、接続は拒否されます。backlog
- 待ち行列の最大長protected abstract void accept(SocketImpl s) throws IOException
s
- 受け入れる接続protected abstract InputStream getInputStream() throws IOException
protected abstract OutputStream getOutputStream() throws IOException
protected abstract int available() throws IOException
protected abstract void close() throws IOException
protected FileDescriptor getFileDescriptor()
fd
フィールド値を返します。fd
フィールド値fd
protected InetAddress getInetAddress()
address
フィールド値を返します。address
フィールド値address
protected int getPort()
port
フィールド値を返します。port
フィールド値port
protected int getLocalPort()
localport
フィールド値を返します。localport
フィールド値localport
public String toString()
String
として返します。
|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |