public class SocketConnection
extends java.lang.Object
XConnection
interface
and is uses by the SocketConnector
and the SocketAcceptor
.
This class is not part of the provided api
.
com.sun.star.comp.connections.SocketAcceptor
,
com.sun.star.comp.connections.SocketConnector
,
com.sun.star.connections.XConnection
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_description |
protected boolean |
_firstRead |
protected java.io.InputStream |
_inputStream |
protected java.util.Vector |
_listeners |
protected java.io.OutputStream |
_outputStream |
protected java.net.Socket |
_socket |
static boolean |
DEBUG
When set to true, enables various debugging output.
|
Constructor and Description |
---|
SocketConnection(java.lang.String description,
java.net.Socket socket)
Constructs a new
SocketConnection . |
Modifier and Type | Method and Description |
---|---|
void |
addStreamListener(XStreamListener aListener) |
void |
close()
Closes the connection.
|
void |
flush()
Flushes the buffer.
|
java.lang.String |
getDescription()
Gives a description of the connection.
|
int |
read(byte[][] bytes,
int nBytesToRead)
Read the required number of bytes.
|
void |
removeStreamListener(XStreamListener aListener) |
void |
write(byte[] aData)
Write bytes.
|
public static final boolean DEBUG
protected java.lang.String _description
protected java.net.Socket _socket
protected java.io.InputStream _inputStream
protected java.io.OutputStream _outputStream
protected java.util.Vector _listeners
protected boolean _firstRead
public SocketConnection(java.lang.String description, java.net.Socket socket) throws java.io.IOException
SocketConnection
.
description
- the description of the connectionsocket
- the socket of the connectionjava.io.IOException
public void addStreamListener(XStreamListener aListener) throws com.sun.star.uno.RuntimeException
com.sun.star.uno.RuntimeException
public void removeStreamListener(XStreamListener aListener) throws com.sun.star.uno.RuntimeException
com.sun.star.uno.RuntimeException
public int read(byte[][] bytes, int nBytesToRead) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException
aReadBytes
- the outparameter, where the bytes have to be placednBytesToRead
- the number of bytes to readcom.sun.star.io.IOException
com.sun.star.uno.RuntimeException
com.sun.star.connections.XConnection#read
public void write(byte[] aData) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException
aData
- the bytes to writecom.sun.star.io.IOException
com.sun.star.uno.RuntimeException
com.sun.star.connections.XConnection#write
public void flush() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException
com.sun.star.io.IOException
com.sun.star.uno.RuntimeException
com.sun.star.connections.XConnection#flush
public void close() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException
com.sun.star.io.IOException
com.sun.star.uno.RuntimeException
com.sun.star.connections.XConnection#close
public java.lang.String getDescription() throws com.sun.star.uno.RuntimeException
com.sun.star.uno.RuntimeException
com.sun.star.connections.XConnection#getDescription