Click or drag to resize

ServerChannel Class

Allows an application to provide customized services via the OBCOM NetServer.
Inheritance Hierarchy
SystemObject
  OBCOM.NetClientServerChannel

Namespace:  OBCOM.NetClient
Assembly:  OBCOM.NetClient (in OBCOM.NetClient.dll) Version: 40.82.5945.17884 (40.82.5945.17884)
Syntax
public class ServerChannel

The ServerChannel type exposes the following members.

Constructors
  NameDescription
Public methodServerChannel
Constructs a new ServerChannel instance.
Top
Properties
  NameDescription
Public propertyLayoutManager
Returns the LayoutManager of the ServerChannel.
Public propertyMetaServerPID
Returns the MetaServer Process ID of the ServerChannel.
Public propertyName
Returns the name of the ServerChannel.
Public propertyNetServerHost
Returns OBCOM NetServer host address (name or IP number) of the ServerChannel.
Public propertyNetServerPort
Returns OBCOM NetServer port number of the ServerChannel.
Public propertyNetServerURI
Returns OBCOM NetServer URI (protocol, host and port) of the ServerChannel.
Public propertyReplyMissing
Returns true if no reply message has been sent for the current transaction.
Public propertySessionID
Returns the session ID of the ServerChannel.
Public propertyTimeout
Indicates the maximum time to wait for an event.
Public propertyTranBootHost
Returns the boot host name of the current transaction.
Public propertyTranClientName
Returns the client name of the current transaction.
Public propertyTranDefaultHost
Returns the default host name of the current transaction.
Public propertyTranLocalHost
Returns the local host name of the current transaction.
Public propertyTranOriginator
Returns the originator name of the current transaction.
Public propertyTranOriginatorSession
Returns the originator session name of the current transaction.
Public propertyTranOriginatorStation
Returns the originator station name of the current transaction.
Public propertyTranProcessName
Returns the process name of the current transaction.
Public propertyTranSecurityHost
Returns the security host name of the current transaction.
Public propertyTranSequence
Returns the sequence code of the current transaction.
Public propertyTranSessionID
Returns the session ID of the current transaction.
Public propertyTranTimestamp
Returns the timestamp of the current transaction.
Public propertyVersion
Returns the implementation version of the ServerChannel.
Top
Methods
  NameDescription
Public methodBeginTransaction
Called before a transaction request is processed by ProcessTransaction(String, Message).
Public methodCancelTimer
Public methodCommitTransaction
Called after a transaction request has been successfuly processed by the ProcessTransaction(String, Message) method.
Public methodConnect(String, String)
Connects the ServerChannel to OBCOM NetServer specified by the the supplied arguments.
Public methodConnect(String, String, LayoutManager)
Connects the ServerChannel to OBCOM NetServer specified by the the supplied arguments.
Public methodConnect(String, String, String)
Connects the ServerChannel to OBCOM NetServer specified by the the supplied arguments.
Public methodDisableMulticast
Disables the reception of multicast messages identified by the specified name.
Public methodEnableMulticast(String)
Enables the reception of multicast messages identified by the specified name.
Public methodEnableMulticast(String, MulticastListener)
Enables the reception of multicast messages identified by the specified name and supplied listener.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExecute(String, String)
Starts the execution of this ServerChannel using the supplied arguments.
Public methodExecute(String, String, LayoutManager)
Starts the execution of this ServerChannel using the supplied arguments.
Public methodExecute(String, String, String)
Starts the execution of this ServerChannel using the supplied arguments.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetLayout
Returns the Layout identified by the supplied layoutName.
Public methodGetTimestamp
Returns an OBCOM NetServer timestamp.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodProcessHalt
Called when a Halt message is received from OBCOM NetServer.
Public methodProcessInit
Called when an Initialize or Reinitialize message is received from OBCOM NetServer.
Public methodProcessMulticast
Called when a multicast message is received from OBCOM NetServer.
Public methodProcessOneWay
Called when a one-way message is received.
Public methodProcessReply
Called when an asynchronous transaction reply message is received from OBCOM NetServer.
Public methodProcessTimeout
Called when a Timeout Event occurs.
Public methodProcessTimer
Called when a Timer Event occurs.
Public methodProcessTransaction
Called when a transaction request message is received from OBCOM NetServer.
Public methodRegisterTransaction
Registers a listener for transactions identified by name.
Public methodReleaseHold
Releases the hold on this server so it can continue to receive messages.
Public methodRollbackTransaction
Called when an exception is thrown while processing a transaction.
Public methodRunAsync
Submits an action for later execution on the server's thread.
Public methodSendAckReply
Sends a transaction reply message with a ACK code, indicating successful completion
Public methodSendConsole
Sends a console command to OBCOM NetServer.
Public methodSendError
Sends an error report message to OBCOM NetServer.
Public methodSendMulticast(String, Object)
Sends a multicast message to OBCOM NetServer
Public methodSendMulticast(String, Object, Boolean)
Sends an multicast message to OBCOM NetServer with encryption option.
Public methodSendNakReply
Sends a transaction reply message with a NAK code, indicating unsuccessful completion
Public methodSendOneWay(String, Object)
Sends a one-way message to the named destination.
Public methodSendOneWay(String, Object, Boolean)
Sends a one-way message to the named destination with encryption.
Public methodSendOperator
Sends a operator command to OBCOM NetServer.
Public methodSendReply(Object, Int32)
Sends a transaction reply message with the supplied replyCode.
Public methodSendReply(Object, Int32, Boolean)
Sends a transaction reply message with the supplied replyCode and required server hold state.
Public methodSendRequest(String, Object)
Sends an asynchronous transaction to the specified service with supplied request data.
Public methodSendRequest(String, Object, ReplyListener)
Sends an asynchronous transaction to the specified service with supplied request data and listener.
Public methodSendRequest(String, Object, ReplyListener, Object)
Sends an asynchronous transaction to the specified service with supplied request data, listener and context.
Public methodSendTransaction(String, Object)
Sends an synchronous transaction request to the specified service using the supplied request data
Public methodSendTransaction(String, Object, Int32)
Sends an synchronous transaction to the specified service with supplied request data and timeout option.
Public methodStartTimer(Double)
Schedules the execution of the ProcessTimer method of the ServerChannel at approximately regular intervals separated by interval.
Public methodStartTimer(Double, TimerListener)
Schedules the execution of the ProcessTimer method of the supplied listener at approximately regular intervals separated by interval.
Public methodStop
Stops the execution of this ServerChannel.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnregisterTransaction
Unregisters the transaction listener identified by name.
Top
Remarks

Once the communcation is established with the NetServer, the application is able to receive transaction requests, send unsolicited data, and provide other services to the clients of an NetServer.

A server application is constructed by extending the ServerChannel class and then overriding the ProcessXXXXXXX methods. For example, the ProcessTransaction method is called each time the server receives a transaction request from an NetServer client application (see ClientChannel for details about building NetServer client applications).

The following example uses ServerChannel to implement a server application named "SampleServer". This server is very simple: it just echos the data received in all transaction requests:

using OBCOM.NetClient;

public class SampleServer : ServerChannel
{
    // Called when a transaction request arrives
    public override void ProcessTransaction(string name, Message message)
    {
         SendAckReply("The reply message is " + message.Data);
    }

    // Startup method of SampleServer
    public static void Main(string[] args)
    {
        SampleServer server = new SampleServer();
        server.Execute("CSERVER", "nets://host:10102", "http://host/layouts/*.jsp");
    }
}
See Also