hp.infrared
Class IrServerSocket

java.lang.Object
  |
  +--hp.infrared.IrServerSocket

public class IrServerSocket
extends java.lang.Object

This class implements a server socket over Infrared medium.

See Also:
IrSocket

Constructor Summary
IrServerSocket(int port)
          Creates an infrared server socket on a specified port.
IrServerSocket(int port, int backlog)
          Creates an infrared server socket on a specified port with the specified backlog.
IrServerSocket(java.lang.String servicename)
          Creates an infrared server socket attached to the specified servicename.
IrServerSocket(java.lang.String servicename, int backlog)
          Creates an infrared server socket attached to the specified servicename and the specified backlog.
 
Method Summary
 IrSocket accept()
          Listens for a connection to be made to this socket and accepts it.
 void close()
          Closes this socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IrServerSocket

public IrServerSocket(int port)
               throws java.io.IOException
Creates an infrared server socket on a specified port.
Parameters:
port - the port number
Throws:
java.io.IOException - if an I/O error occurs while creating the server socket

IrServerSocket

public IrServerSocket(int port,
                      int backlog)
               throws java.io.IOException
Creates an infrared server socket on a specified port with the specified backlog.
Parameters:
port - the port number
Throws:
java.io.IOException - if an I/O error occurs while creating the server socket

IrServerSocket

public IrServerSocket(java.lang.String servicename)
               throws java.io.IOException
Creates an infrared server socket attached to the specified servicename.
Parameters:
servicename - name of the service
Throws:
java.io.IOException - if an I/O error occurs while creating the server socket

IrServerSocket

public IrServerSocket(java.lang.String servicename,
                      int backlog)
               throws java.io.IOException
Creates an infrared server socket attached to the specified servicename and the specified backlog.
Parameters:
servicename - name of the service
Throws:
java.io.IOException - if an I/O error occurs while creating the server socket
Method Detail

accept

public IrSocket accept()
                throws java.io.IOException
Listens for a connection to be made to this socket and accepts it.
Returns:
An IrSocket for the connection.
Throws:
java.io.IOException - if an I/O error occurs while waiting for the connection.

close

public void close()
           throws java.io.IOException
Closes this socket.
Throws:
java.io.IOException - if I/O error occurs when closing the socket.