lec13 - Networking Support In Java Nelson Padua-Perez Bill...

This preview shows page 1 - 7 out of 30 pages.

Networking Support In Java Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park
Image of page 1

Subscribe to view the full document.

Testing (old topic) You must write test cases Release tests are designed so that they don’t give you enough information; you have to write test cases In many cases, people were failing release tests and if they had written any test for their failing methods, they would have found the error We are making some changes to provide better feedback about the quality of your test cases We will beat on you if you don’t write test cases
Image of page 2
Overview Networking Background Concepts Network applications Java’s objected-oriented view Java’s networking API (Application Program Interface) Everything you need to know: Last lecture This lecture
Image of page 3

Subscribe to view the full document.

Client / Server Model Relationship between two computer programs Client Initiates communication Requests services Server Receives communication Provides services Other models Peer-to-peer (P2P) Client Client Client Server Server Client
Image of page 4
Client Programming Basic steps 1. Determine server location – IP address & port 2. Open network connection to server 3. Write data to server (request) 4. Read data from server (response) 5. Close network connection 6. Stop client
Image of page 5

Subscribe to view the full document.

Simple Server Programming Basic steps 1. Determine server location - port (& IP address) 2. Create ServerSocket to listen for connections 3. While (true) { 4. accept network connection to client 5. Read data from client (request) 6. Write data to client (response) 7. Close network connection to client 8.
Image of page 6
Image of page 7

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern