|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttcl.lang.channel.Channel
tcl.lang.channel.AbstractSocketChannel
tcl.lang.channel.SocketChannel
public class SocketChannel
The SocketChannel class implements a channel object for Socket connections, created using the socket command.
Field Summary |
---|
Fields inherited from class tcl.lang.channel.Channel |
---|
blocking, buffering, bufferSize, encoding, eofInputFilter, eofOutputFilter, eolInputFilter, eolOutputFilter, finalInputStream, finalReader, firstOutputStream, firstWriter, inputBuffer, inputEofChar, inputTranslation, markableInputStream, mode, nonBlockingOutputStream, outputBuffer, outputEofChar, outputTranslation, rawInputStream, rawOutputStream, READ_OWNERSHIP, refCount, unicodeDecoder, unicodeEncoder, WRITE_OWNERSHIP |
Constructor Summary | |
---|---|
SocketChannel(Interp interp,
int mode,
String localAddr,
int localPort,
boolean async,
String address,
int port)
Constructor - creates a new SocketChannel object with the given options. |
|
SocketChannel(Interp interp,
Socket s)
Constructor for making SocketChannel objects from connections made to a ServerSocket. |
Method Summary | |
---|---|
protected void |
connectSocket(InetAddress addr,
int port,
InetAddress localAddress,
int localPort)
Create the 'sock' field and connect the Socket |
TclObject |
getError(Interp interp)
This option gets the current error status of the given socket. |
protected InputStream |
getInputStream()
This method should be overridden in the subclass to provide a channel specific InputStream object. |
protected OutputStream |
getOutputStream()
This method should be overridden in the subclass to provide a channel specific OutputStream object. |
Methods inherited from class tcl.lang.channel.AbstractSocketChannel |
---|
getPeerName, getSockName, setOutputTranslation |
Methods inherited from class tcl.lang.channel.Channel |
---|
checkRead, checkWrite, close, eof, flush, getBlocking, getBuffering, getBufferSize, getChanName, getEncoding, getInputEofChar, getInputTranslation, getOutputEofChar, getOutputTranslation, initInput, initOutput, isBlocked, isClosed, isReadOnly, isReadWrite, isWriteOnly, read, seek, setBlocking, setBuffering, setBufferSize, setEncoding, setInputEofChar, setInputTranslation, setOutputEofChar, setOwnership, setOwnership, tell, waitForOwnership, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SocketChannel(Interp interp, int mode, String localAddr, int localPort, boolean async, String address, int port) throws IOException, TclException
interp
- the current interpreterlocalAddr
- localAddress to use, or empty string if default is to be usedlocalPort
- local port to use, or 0 if any port is to be usedasync
- true if socket should be connected asynchronouslyaddress
- IP address or hostname to connect toport
- port to connect to
IOException
TclException
public SocketChannel(Interp interp, Socket s) throws IOException, TclException
interp
- the current interpreters
- A connected socket from which to create a channel
IOException
TclException
Method Detail |
---|
protected void connectSocket(InetAddress addr, int port, InetAddress localAddress, int localPort)
addr
- Address to connect toport
- Port to connect tolocalAddress
- Local address to bind, or null for defaultlocalPort
- Local port to bind to, or 0 for any port
IOException
protected InputStream getInputStream() throws IOException
Channel
getInputStream
in class Channel
IOException
protected OutputStream getOutputStream() throws IOException
Channel
getOutputStream
in class Channel
IOException
public TclObject getError(Interp interp) throws TclException
AbstractSocketChannel
getError
in class AbstractSocketChannel
interp
- current interpreter, for errors
TclException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |