tcl.lang.channel
Class AbstractSocketChannel

java.lang.Object
  extended by tcl.lang.channel.Channel
      extended by tcl.lang.channel.AbstractSocketChannel
Direct Known Subclasses:
ServerSocketChannel, SocketChannel

public abstract class AbstractSocketChannel
extends Channel

This abstract class allows fconfigure to query information about a socket channel


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
AbstractSocketChannel()
           
 
Method Summary
abstract  TclObject getError(Interp interp)
          This option gets the current error status of the given socket.
 TclObject getPeerName(Interp interp)
          This method returns a list of three elements; these are the address, the host name and the port to which the peer socket is connected or bound.
 TclObject getSockName(Interp interp)
          This option returns a list of three elements, the address, the host name and the port number for the socket.
 void setOutputTranslation(int translation)
          if output translation is set to AUTO, sockets are crlf regardless of platform
 
Methods inherited from class tcl.lang.channel.Channel
checkRead, checkWrite, close, eof, flush, getBlocking, getBuffering, getBufferSize, getChanName, getEncoding, getInputEofChar, getInputStream, getInputTranslation, getOutputEofChar, getOutputStream, 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

AbstractSocketChannel

public AbstractSocketChannel()
Method Detail

getPeerName

public TclObject getPeerName(Interp interp)
                      throws TclException
This method returns a list of three elements; these are the address, the host name and the port to which the peer socket is connected or bound. If the host name cannot be computed, the second element of the list is identical to the address, its first element

Parameters:
interp - current interpreter, for errors
Returns:
TclList containing address, host name and port
Throws:
TclException

getSockName

public TclObject getSockName(Interp interp)
                      throws TclException
This option returns a list of three elements, the address, the host name and the port number for the socket. If the host name cannot be computed, the second element is identical to the address, the first element of the list.

Parameters:
interp - current interpreter, for errors
Returns:
TclList containing address, host name and port
Throws:
TclException

setOutputTranslation

public void setOutputTranslation(int translation)
if output translation is set to AUTO, sockets are crlf regardless of platform

Overrides:
setOutputTranslation in class Channel
Parameters:
translation - one of the TclIO.TRANS_* constants
See Also:
Channel.setOutputTranslation(int)

getError

public abstract TclObject getError(Interp interp)
                            throws TclException
This option gets the current error status of the given socket. This is useful when you need to determine if an asynchronous connect operation succeeded. If there was an error, the error message is returned. If there was no error, an empty string is returned.

Parameters:
interp - current interpreter, for errors
Returns:
Error message or empty string if no error
Throws:
TclException


Copyright © 2015. All rights reserved.