|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kom.tools.ipc.IPCConnection
This is a connection between a client and a server. The connection exists on both network sides. One will be generated on the client side when the client attempts to connect a server. Another connection will be generated on the server side when the server accepts a connection from the client.
Field Summary | |
protected java.io.InputStream |
inputStream
The stream for reading data |
protected java.io.OutputStream |
outputStream
The stream for sending data |
java.net.Socket |
socket
The communication socket |
Constructor Summary | |
IPCConnection(java.net.Socket s)
Class constructor |
Method Summary | |
int |
available()
Checks for available data on the socket |
void |
close()
Closes the current connection |
java.io.InputStream |
getInputStream()
Returns the input stream |
java.io.OutputStream |
getOutputStream()
Returns the output stream |
int |
read(byte[] buffer,
int size)
Waits for data and receives it (blocks until data available) |
int |
read(IPCBuffer buffer)
Waits for data and receives it (blocks until data available) |
java.lang.String |
readLine()
Reads a line of data from the input stream |
boolean |
write(byte[] data)
Sends data over the network |
boolean |
write(IPCBuffer buffer)
Sends data over the network |
boolean |
write(java.lang.String data)
Sends data over the network |
Methods inherited from class java.lang.Object |
|
Field Detail |
public java.net.Socket socket
protected java.io.InputStream inputStream
protected java.io.OutputStream outputStream
Constructor Detail |
public IPCConnection(java.net.Socket s)
s
- the communication socketMethod Detail |
public int available()
public int read(IPCBuffer buffer)
buffer
- Storage for the data receivedpublic int read(byte[] buffer, int size)
buffer
- Storage for the data receivedsize
- Max used size of bufferpublic java.lang.String readLine()
public boolean write(IPCBuffer buffer)
buffer
- data to be sentpublic boolean write(byte[] data)
data
- data to be sentpublic boolean write(java.lang.String data)
data
- data to be sentpublic void close()
public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |