Lecture 15B
Serving PhysicsSim
DataMonitorDesign
Run Data Server
Run Data Client
Data S
erver Code
Physics Sim Code
Data Client Code

Lectures

1A: Introduction
1B: Java Intro
2A: BuildingBlocks
2B: Objects
3A: More Objects
3B: Exceptions
       & Threads
4A: Waves
4B: Nuclear &
       Particle
5A: AWT
5B: More AWT
      & Graphics
6A:Detectors &
      Simulation
6B: LHC/Atlas &
     RandomSims    
7A: Swing
7B: Java2D
8A: Java Apps
8B: Dialogs &
    MoreClasses
9A: Java I/O
9B: Utilities,
        Unicode
10A: More
    Threading
10B: File
    Handling
11A: Array,Print,
    Images
11B: SimplePhysics
    Simulation
12A: Tips &
    Techniques
12B: More Tips &
    Techniques
13A: Satellite
    
Simulations
13B: Intro to Java
    Networking
14A: Java Servers
14B: HTTP Server
15A: ServerClient
15B: ServerClient
   Expt.Simulation
16A: Course
          Review
16B: ExerciseTest
        Discussion

    Contacts
    Description
    Exercises
    Index
    Outline
    Q&A
    Resources
    StudentInfoForm
    Student Pages
    What's New

 

Home : Lectures : Lecture 15B : Run DataServer
Running the DataServer

DataServer is started, in the directory above the DataMonitor subdirectory where it is located, with the command:

c:\> java DataMonitor.DataServer

Below we see both the DOS window where the server is run and the Frame holding the FallingObject applet.

Note that unlike previous server examples, the port number is not an argument. Instead, port 1111 is coded into the program.

In the other lines in the DOS window, we see that the server waits and then a client connects. Using the toString() method for the socket that was created for this client, a print shows the socket host and the remote and local port information.

The server creats a DataReader that sends data from the physics simulator to the client.

We see here that some data was generated and a client has three times requested the data before disconnecting.

 

Home Lectures Resources Index Contacts Students


Physics Simulations with JavaTM
KTH, Kurskod: 5A1418
Curator: Clark S. Lindsey