de.mud.jta.plugin
public class Socket extends Plugin implements FilterPlugin, SocketListener
Maintainer: Matthias L. Jugel
Modifier and Type | Field and Description |
---|---|
protected java.io.InputStream |
in |
protected java.io.OutputStream |
out |
protected java.lang.String |
relay |
protected int |
relayPort |
protected java.net.Socket |
socket |
Constructor and Description |
---|
Socket(PluginBus bus,
java.lang.String id)
Create a new socket plugin.
|
Modifier and Type | Method and Description |
---|---|
void |
connect(java.lang.String host,
int port)
Connect to the host and port passed.
|
void |
disconnect()
Disconnect the socket and close the connection.
|
FilterPlugin |
getFilterSource() |
int |
read(byte[] b)
Read a block of data from the back end.
|
void |
setFilterSource(FilterPlugin plugin)
Set the source plugin where we get our data from and where the data
sink (write) is.
|
void |
write(byte[] b)
Write a block of data to the back end.
|
protected java.net.Socket socket
protected java.io.InputStream in
protected java.io.OutputStream out
protected java.lang.String relay
protected int relayPort
public Socket(PluginBus bus, java.lang.String id)
public void connect(java.lang.String host, int port) throws java.io.IOException
connect
in interface SocketListener
java.io.IOException
public void disconnect() throws java.io.IOException
disconnect
in interface SocketListener
java.io.IOException
public void setFilterSource(FilterPlugin plugin)
FilterPlugin
setFilterSource
in interface FilterPlugin
plugin
- the data sourcepublic FilterPlugin getFilterSource()
getFilterSource
in interface FilterPlugin
public int read(byte[] b) throws java.io.IOException
FilterPlugin
read
in interface FilterPlugin
b
- the buffer to read the data intojava.io.IOException
public void write(byte[] b) throws java.io.IOException
FilterPlugin
write
in interface FilterPlugin
b
- the buffer to be sentjava.io.IOException