Distinct offers Network Monitor, the ONLY natural language Protocol Analyzer, ONC RPC for C++, .NET and Java, and IntelliTerm, the fastest Terminal Emulator for TN3270, TN5250 and VT420 on the market.

Source Code Library

   Products   Downloads   Sales   Support   About us
  Knowledge Base  Ask Cody  Manuals  Source Code Library  Resources



        
 
Product: RPC/XDR Toolkit - for JavaPlatform: JavaLast updated: 11/8/2001
 
Multithreaded JRPC Server
 
The sample illustrates how to implement a multithreaded server.
For comparisons, the same server may be run single or multithreaded.

Again the sample is based on the well-known counter example. First, start
the server either single threaded with
java docount s
or multithreaded with
java docount m
You will see different behavior depending on whether you run a single or a multithreaded server. This is intentional and corrrect because the internal
counter is NOT protected against concurrent access.

Then in at least two other windows start
java testprg localhost inc
or
java testprg localhost dec
The increment and decrement RPC calls include an internal sleep delay to
illustrate the effects of concurrency. Select the UDP or TCP protocol by
uncommenting the appropriate lines.

Note that in the single threaded version all RPCs are put in a queue (and
take longer to process) while in the multithreaded version they are really
processed concurrently. This will also be displayed by the server. It prints
a line on each call and it reports on the number of threads currently active
in RPC procedures.

This sample can be found in the subfolder \samples\thread located under the folder in which you installed the RPC Toolkit for Java.

Download RPC Toolkit for Java
 
 


Samples List


Products

 Network Monitor
The Distinct Network Monitor is a protocol analyzer for Windows that includes both packet sniffing and network traffic statistical analysis tools.

 Intelliterm
The Most Complete Terminal Emulator for TN3270, TN5250 and DEC VT220 to VT420

 RPC for C and C++
The Fastest Way to Port Your Existing Unix-RPC Applications to Windows

  9/5/2008   Legal notices | PRIVACY Policy | Networking News |