Skip to content

Commit e30a771

Browse files
authored
update unspecified write timeout to 3 seconds (#303)
Previously, the memory r/w service assumed that a write operation without a specified timeout would respond in 750msec or less, and acted after one second. The message standard says that unspecified timeouts should not be less than three seconds. This PR updates the write-response behavior to be consistent with that.
1 parent 8192a53 commit e30a771

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/org/openlcb/implementations/MemoryConfigurationService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@ public void handleSuccess(int flags) {
556556
((flags & DatagramService.FLAG_REPLY_PENDING) != 0)) {
557557
// Leave the memo in the pending, will wait for reply datagram.
558558
logger.fine("rcvd RequestWithReplyDatagram with flags "+flags);
559-
int timeout = 1 << (flags & 0x0F);
560-
timeout = timeout * 1000; // to milliseconds
559+
int timeout = 1 << (flags & 0x0F) * 1000; // to msec
560+
if ((flags & 0x0F) == 0) timeout = 3000; // no timeout specified, 3 seconds is default
561561
logger.fine(" and timeout "+timeout+", restarting");
562562
restartTimeout(memo, timeout);
563563
return;

0 commit comments

Comments
 (0)