Presentation is loading. Please wait.

Presentation is loading. Please wait.

Timeouts: The Missing Piece James Whorley. IMPLEMENTING TIMEOUTS IN JAVA SOCKETS Java Socket Programming.

Similar presentations


Presentation on theme: "Timeouts: The Missing Piece James Whorley. IMPLEMENTING TIMEOUTS IN JAVA SOCKETS Java Socket Programming."— Presentation transcript:

1 Timeouts: The Missing Piece James Whorley

2 IMPLEMENTING TIMEOUTS IN JAVA SOCKETS Java Socket Programming

3 Implementing Timeouts in Java Sockets So what’s the plan? The Problem The what it is and why it matters. Sockets and Their Functions Connecting in 3……2……1. Results So what happened? Reflection What have we learned? Questions Fire at will. Item 1 Solving the Problem Making it work. Item 2 Item 3 Item 4 Item 5 Item 6

4 The Problem Problem: Java Socket API Lacks Timeouts Proposal: To create an adaptable platform for application developers to control timeouts. To gain a level of confidence that comes from a standardized solution. What it is and why does it matter?

5 Sockets and Their Function Java provides two way of connecting to a service URL Processing Socket Programming - Most widely used! Our Focus: Socket Programming Comprised of two main classes ServerSocket and Socket Server accepts Socket from Client Communication ensues on specified port Connecting in 3……2……1

6 Solving the Problem Planning the Solution Game Theory Model: Prisoner’s Dilemma 5 Stages to Complete 1. Design 2. Research 3. Modification 4. Development 5. Testing Making it work.

7 Solving the Problem Game Theory Model: Prisoner’s Dilemma Making it work. PRISONER 2 Doesn’t Talk Talks PRISONER 1 Doesn’t Talk 10 Talks 00

8 Solving the Problem Prisoner’s Dilemma Applied to Socket Timeout Making it work. SYSTEM DoneNot Done USER Done 10 Not Done 00

9 Solving the Problem Making it work.

10 After only a bit of headache… Image retrieved from: www.gitter-graphics.com

11 Developed working model Default system timeout: 1 min Default user timeout: 10 min Can force timeout by setting both user and system variables to done. Tested client/server interaction Tested functionality against both single and multiple connects to the server to check for erratic behavior. Results So What Happened?

12 Sockets are the most popular way to connect to a service with Java. Timeout capability not standard to sockets. A Prisoner’s Dilemma timeout is a great implementation to socket programming. Reflection What have we learned?

13 Questions Fire at will…

14 References Basics in Client/Server communication in Java http://itsitrc.blogspot.com/2013/12/client-server-socket-programming-in-java.html Mattew Cook and Syed(shawon)M. Rahman,” Java and C/C++ language feature in terms of Network Programming,” 2005. Elliotte Rusty Harold,”Java Network Programming,” O’Reilly, 3rd edition, October 2004. Java Docs for Sockets http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html


Download ppt "Timeouts: The Missing Piece James Whorley. IMPLEMENTING TIMEOUTS IN JAVA SOCKETS Java Socket Programming."

Similar presentations


Ads by Google