org.lirc.socket
Class UnixSocket

java.lang.Object
  |
  +--org.lirc.socket.UnixSocket

public class UnixSocket
extends java.lang.Object

A Unix domain socket. The interface is similar to the Socket class from the standard library.

Version:
$Revision: 1.1 $
Author:
Bjorn Bringert (bjorn@mumblebee.com)

Constructor Summary
  UnixSocket(java.lang.String path)
          Creates a new UnixSocket connected to a path.
protected UnixSocket(UnixSocketImpl impl)
          Creates a new UnixSocket from a UnixSocketImpl.
 
Method Summary
 void close()
          Closes this socket
 java.io.InputStream getInputStream()
          Returns an input stream for this socket.
 java.io.OutputStream getOutputStream()
          Returns an output stream for this socket.
 void shutdownInput()
          Disables the input stream for this socket.
 void shutdownOutput()
          Disables the output stream for this socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnixSocket

public UnixSocket(java.lang.String path)
           throws java.io.IOException
Creates a new UnixSocket connected to a path.
Parameters:
path - The path name of the socket to connect to

UnixSocket

protected UnixSocket(UnixSocketImpl impl)
              throws java.io.IOException
Creates a new UnixSocket from a UnixSocketImpl.
Method Detail

close

public void close()
           throws java.io.IOException
Closes this socket
Throws:
java.io.IOException - If there is a problem closing the socket

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns an input stream for this socket. Multiple calls to this method on a socket will return the same stream.
Returns:
an input stream for reading bytes from this socket.
Throws:
java.io.IOException - if an I/O error occurs when creating the input stream.

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Returns an output stream for this socket. Multiple calls to this method on a socket will return the same stream.
Returns:
an output stream for writing bytes to this socket.
Throws:
java.io.IOException - if an I/O error occurs when creating the output stream.

shutdownInput

public void shutdownInput()
                   throws java.io.IOException
Disables the input stream for this socket.
Throws:
java.io.IOException - if an I/O error occurs when shutting down this socket.

shutdownOutput

public void shutdownOutput()
                    throws java.io.IOException
Disables the output stream for this socket.
Throws:
java.io.IOException - if an I/O error occurs when shutting down this socket.