public final class Connection extends Object
| Constructor and Description |
|---|
Connection(SocketChannel socketChannel) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static Connection |
create(String host,
int port) |
protected void |
finalize() |
void |
flush() |
int |
getChannelId()
Get channel id
|
int |
getContentId()
Get request/response contentId
|
Map<Integer,String> |
getContentProperties()
Get request content properties
|
String |
getHost() |
static String |
getHost(SocketChannel socketChannel) |
String |
getLocalHost() |
static String |
getLocalHost(SocketChannel socketChannel) |
int |
getLocalPort() |
static int |
getLocalPort(SocketChannel socketChannel) |
int |
getMessageId()
Get request/response messageId of 1st frame
|
int |
getPort() |
static int |
getPort(SocketChannel socketChannel) |
SocketChannel |
getSocketChannel() |
boolean |
isDirectMode() |
InputStream |
openInputStream() |
OutputStream |
openOutputStream() |
void |
prepareForReading() |
void |
setChannelId(int channelId)
Set channel id
|
void |
setContentId(int contentId)
Set request/response contentId
|
void |
setContentProperty(int key,
String value)
Set response content properties
|
void |
setDirectMode(boolean isDirectMode) |
void |
setInputStreamByteBuffer(ByteBuffer messageBuffer)
Set messageBuffer for InputStream
some message part could be preread before
|
void |
setMessageId(int messageId)
Set request/response messageId of 1st frame
|
void |
setSocketChannel(SocketChannel socketChannel) |
String |
toString() |
public Connection(SocketChannel socketChannel)
public SocketChannel getSocketChannel()
public void setSocketChannel(SocketChannel socketChannel)
public void prepareForReading()
throws IOException
IOExceptionpublic InputStream openInputStream() throws IOException
IOExceptionpublic OutputStream openOutputStream() throws IOException
IOExceptionpublic void flush()
throws IOException
IOExceptionpublic boolean isDirectMode()
public void setDirectMode(boolean isDirectMode)
public int getChannelId()
public void setChannelId(int channelId)
public int getMessageId()
public void setMessageId(int messageId)
public int getContentId()
public void setContentId(int contentId)
public Map<Integer,String> getContentProperties()
public void setContentProperty(int key,
String value)
public void setInputStreamByteBuffer(ByteBuffer messageBuffer)
public void close()
throws IOException
IOExceptionpublic static Connection create(String host, int port) throws IOException
IOExceptionprotected void finalize()
throws Throwable
public String getHost()
public int getPort()
public String getLocalHost()
public int getLocalPort()
public static String getHost(SocketChannel socketChannel)
public static int getPort(SocketChannel socketChannel)
public static String getLocalHost(SocketChannel socketChannel)
public static int getLocalPort(SocketChannel socketChannel)
Copyright © 2005–2018 Oracle Corporation. All rights reserved.