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

How does the java sockets obtain clock information from the real-time clock. The reason I want to know is, I  have  subclasses of java.net.socket, and java.net.serversocket 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
debriscaAsked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
Override get/setSOTimeout() and scale the value according to your virtual clock.
0
 
CEHJCommented:
The timeouts are given by an offset from now (the time the method executes). You could map that duration to one of your own
0
 
debriscaAuthor Commented:
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.
Thanks
0
 
CEHJCommented:
OK ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.