Home My Page Projects Code Snippets Project Openings SML/NJ Bugs
Summary Activity Tracker Lists

[#113] Socket.select waits exactly twice the indicated timeout

Date:
2013-04-17 16:09
Priority:
3
State:
Closed
Submitted by:
Bug Submitter (webuser)
Assigned to:
Nobody (None)
Machine Architecture:
x86
Operating System:
Other
Component:
Basis Library
Resolution:
None
Severity:
Minor
OS Version:
Windows 7
SML/NJ Version:
110.74
Keywords:
socket select timeout
URL:
Transcript (of reproduction):
- wait 2; val it = 4 : IntInf.int - wait 3; val it = 6 : IntInf.int - wait 4; val it = 8 : IntInf.int - wait 15; val it = 30 : IntInf.int
Source (for reproduction):
val sd = blahblah fun wait n = let val t = Time.toSeconds (Time.now ()) in Socket.select {rds=[sd], wrs=[], exs=[], timeout = SOME (Time.fromSeconds n)}; Time.toSeconds (Time.now ()) - t end
Summary:
Socket.select waits exactly twice the indicated timeout

Detailed description
When Socket.select is used with a timeout, it waits exactly twice
as long as the indicated timeout.

Submitted via web form by Karl Crary crary@cs.cmu.edu

Comments:

Message  ↓
Date: 2013-04-26 20:48
Sender: John Reppy

Fixed in 110.76.

Date: 2013-04-19 18:08
Sender: John Reppy

The problem appears to be in the implementation of OS.IO.poll in system/Basis/Implementation/Win32/os-io.sml.

Attached Files:

Changes

Field Old Value Date By
status_idOpen2013-04-26 20:48jhr
close_date2013-04-26 20:482013-04-26 20:48jhr