org.objectweb.tribe.channel.tcp
Class TcpServerChannel

java.lang.Object
  extended byorg.objectweb.tribe.channel.AbstractServerChannel
      extended byorg.objectweb.tribe.channel.tcp.TcpServerChannel

public class TcpServerChannel
extends AbstractServerChannel

This class defines a TcpServerChannel

Version:
1.0
Author:
Emmanuel Cecchet

Constructor Summary
TcpServerChannel()
          Creates a new unbound TcpServerChannel
TcpServerChannel(int port)
          Creates a new TcpServerChannel bound to the specified port.
 
Method Summary
 AbstractReliableFifoChannel accept()
          Accepts a new incoming connection.
 void bind(Address source)
          Binds a source address
 void close()
          Closes the serverSocket.
 Address getBindAddress()
          Get the address on which this channel is bound.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TcpServerChannel

public TcpServerChannel()
                 throws java.io.IOException
Creates a new unbound TcpServerChannel

Throws:
java.io.IOException - if an error occurs

TcpServerChannel

public TcpServerChannel(int port)
                 throws java.io.IOException
Creates a new TcpServerChannel bound to the specified port. If port is 0, then the socket is bound to an available port chosen by the system.

Parameters:
port - bind the socket to the given port (0 let the system choose an available port).
Throws:
java.io.IOException - if an error occurs
Method Detail

bind

public void bind(Address source)
          throws ChannelException
Description copied from class: AbstractServerChannel
Binds a source address

Specified by:
bind in class AbstractServerChannel
Parameters:
source - source address to bind
Throws:
ChannelException - if an error occurs
See Also:
org.objectweb.tribe.serverSocket.AbstractServerChannel#bind(org.objectweb.tribe.common.Address)

getBindAddress

public Address getBindAddress()
                       throws NotConnectedException
Description copied from class: AbstractServerChannel
Get the address on which this channel is bound.

Specified by:
getBindAddress in class AbstractServerChannel
Throws:
NotConnectedException - if the channel is not connected.
See Also:
AbstractServerChannel.getBindAddress()

accept

public AbstractReliableFifoChannel accept()
                                   throws ChannelException
Description copied from class: AbstractServerChannel
Accepts a new incoming connection.

Specified by:
accept in class AbstractServerChannel
Returns:
the new serverSocket
Throws:
ChannelException - if an error occurs
See Also:
org.objectweb.tribe.serverSocket.AbstractServerChannel#accept()

close

public void close()
           throws ChannelException
Description copied from class: AbstractServerChannel
Closes the serverSocket.

Specified by:
close in class AbstractServerChannel
Throws:
ChannelException - if an error occurs.
See Also:
org.objectweb.tribe.serverSocket.AbstractServerChannel#close()


Copyright © 2004 - ObjectWeb Consortium - All Rights Reserved.