how to make java sockets use virtual clock instead of real-time clock

Posted on 2005-04-17
Last Modified: 2013-11-15
How does the java sockets obtain clock information from the real-time clock. The reason I want to know is, I  have  subclasses of, and and I want my sockets to be used by applications that run on a network emulator. The thing is that when I use routines that needs timing information like setSOTimeout, getSOTimeout, I want them to use the virtual clock that my simulator uses instead of the real time physical clock. I hope the question is clear. Thank you for your assistance
Question by:debrisca
    LVL 86

    Expert Comment

    The timeouts are given by an offset from now (the time the method executes). You could map that duration to one of your own
    LVL 92

    Accepted Solution

    Override get/setSOTimeout() and scale the value according to your virtual clock.

    Author Comment

    Well guys, thanks very much, I managed to get it to work by overriding the methods to use the Virtual Clock. I tried to split the points but it ddnt work out for some reason so I gave <b>objects</b> the points.
    LVL 86

    Expert Comment

    OK ;-)

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
    This video teaches viewers about errors in exception handling.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now