All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class AcmeNet.Assn2.EchoService

AcmeNet.Assn2.Service
   |
   +----AcmeNet.Assn2.EchoService

public class EchoService
extends Service
A Service that echoes back the bytes sent to it. This class may be useful for testing your solution for Assignment 2.

See Also:
Service

Variable Index

 o DefaultServiceNum
The default service number for the EchoService.

Constructor Index

 o EchoService(ClientServerNI)
Creat an EchoServer at a default service number
 o EchoService(ClientServerNI, int)
Create an EchoService at a given service number.

Method Index

 o getAddress()
Get the address of this service.
 o main(String[])
A program that starts an EchoService.
 o serviceConnection(Connection)
Handle a connection from a client of this service.

Variables

 o DefaultServiceNum
 public static final int DefaultServiceNum
The default service number for the EchoService.

Constructors

 o EchoService
 public EchoService(ClientServerNI ni,
                    int serviceNum) throws AlreadyBoundException
Create an EchoService at a given service number.

Parameters:
ni - the network interface this service should use
serviceNum - the service number to bind this service to
Throws: AlreadyBoundException
there was already a service bound to the requested service number
 o EchoService
 public EchoService(ClientServerNI ni) throws AlreadyBoundException
Creat an EchoServer at a default service number

Parameters:
ni - the network interface this service should use
Throws: AlreadyBoundException
there was already a service bound to the default service number

Methods

 o main
 public static void main(String argv[]) throws AlreadyBoundException
A program that starts an EchoService.

 o getAddress
 public ServiceAddress getAddress()
Get the address of this service.

Returns:
the address of this service
 o serviceConnection
 public void serviceConnection(Connection conn)
Handle a connection from a client of this service.

Overrides:
serviceConnection in class Service

All Packages  Class Hierarchy  This Package  Previous  Next  Index