sleep.bridges.io
Class SocketObject

java.lang.Object
  extended by sleep.bridges.io.IOObject
      extended by sleep.bridges.io.SocketObject

public class SocketObject
extends IOObject


Nested Class Summary
static class SocketObject.SocketHandler
           
 
Field Summary
static int CONNECT_FUNCTION
           
static int LISTEN_FUNCTION
           
protected  java.net.Socket socket
           
 
Fields inherited from class sleep.bridges.io.IOObject
buffer, in, out, reader, readerb, readeru, thread, token, writerb, writeru
 
Constructor Summary
SocketObject()
           
 
Method Summary
 void close()
          Closes all of the reader's / writer's opened by this IOObject.
 java.lang.Object getSource()
          returns the socket used for this connection
 void listen(SocketObject.SocketHandler params, ScriptEnvironment env)
           
 void open(SocketObject.SocketHandler params, ScriptEnvironment env)
           
static void release(int port)
          releases the socket binding for the specified port
 
Methods inherited from class sleep.bridges.io.IOObject
getBuffer, getConsole, getInputBuffer, getInputStream, getOutputStream, getReader, getThread, getToken, getWriter, isEOF, openRead, openWrite, print, printLine, readCharacter, readLine, sendEOF, setEncoding, setThread, setToken, wait
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socket

protected java.net.Socket socket

LISTEN_FUNCTION

public static final int LISTEN_FUNCTION
See Also:
Constant Field Values

CONNECT_FUNCTION

public static final int CONNECT_FUNCTION
See Also:
Constant Field Values
Constructor Detail

SocketObject

public SocketObject()
Method Detail

getSource

public java.lang.Object getSource()
returns the socket used for this connection

Overrides:
getSource in class IOObject

open

public void open(SocketObject.SocketHandler params,
                 ScriptEnvironment env)

release

public static void release(int port)
releases the socket binding for the specified port


listen

public void listen(SocketObject.SocketHandler params,
                   ScriptEnvironment env)

close

public void close()
Description copied from class: IOObject
Closes all of the reader's / writer's opened by this IOObject. If the IO Source object opens any streams, this method should be overriden to close those streams when requested. Calling super.close() is highly recommended as well.

Overrides:
close in class IOObject