1 / 11

CS 461 Distributed Computing

CS 461 Distributed Computing. Assignment 2 Help Session Rege Colwell October 9, 1997. What we give you. a working copy of ReliableNI (I think) ServiceAddress & PacketTypeCode A NetAddress (machine+port) & Service # Constants for packet Types Service, ServiceThread, EchoService

tadita
Télécharger la présentation

CS 461 Distributed Computing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 461 Distributed Computing Assignment 2 Help Session Rege Colwell October 9, 1997

  2. What we give you • a working copy of ReliableNI (I think) • ServiceAddress & PacketTypeCode • A NetAddress (machine+port) & Service # • Constants for packet Types • Service, ServiceThread, EchoService • Code to start your own service and an Example • New Service = extend service & override servConn

  3. You must Implement • ClientServerNI • Lets many clients connect() to services • binds() servers so clients can connect() • Connection • 2 Ends connected by 2 streams

  4. New Features • Connection Based • No more mailboxes, 2 way connection • Services • Create new threads for each connection • Dead Connection Detection - You Still there?! • Ping - pong

  5. Client Server Network Interface • Do NOT inherit from ReliableNI, NetworkInterface, or anything else! • Use a ReliableNI as a private variable • Do bookkeeping on services offered and manage connections • Each CSNI has many services and connections

  6. Public CSNI Methods (Required) • Constructors, getAddress • bind/unbindService • Manipulate Data Structure that keeps track of bindings • Enable - Avoids false rejects in server startup • Common Mistake: Don’t forget to call enable • Run - Get packet, deal with it, get packet, … Server Client csni = new CSNI(. . .) csni.Bind(99, printService) Connect(Server, 99)

  7. Connections • One end of a phone connection • Anything put into connection comes out the other end • unique id number (per CSNI) • Each two-way connection has 2 id numbers (different number on either side) • Protocol says: use recipient's ID (accepts and connect slightly different)

  8. Connection Methods • Constructors - Does not create 2 way connection • getInputStream() - stream to get data from other end • getOutputStream() - stream to send stuff out to other end • Don’t forget to Flush! • getPeerAddress() - address of other end of the connection

  9. Data Streams • Make look like “ABCD” • or “WXYZ” into • Need to make new kind of InputStream that can read from multiple packets • Output stream must be able to break data into packet sized chunks A B C D W X Y Z

  10. Useful Java Things • Classes: hashTable, Vector • Both in java.util • Vector is “dynamic array” • Check out java API under misc. on homepage • Class variables are global to a class • static int iNum; • Static Initializers - run when class is init’ed • static { }

  11. Keep your grader happy A+ • index.html • How to compile • How to run your test(s) • Links to source files

More Related