AR# 54024 Description Threading issues at connection timeout --- client --- Transcript clear. client := RequestBroker newSRBStstTcpAtPort: 42423. client objectAdaptor connectionTimeout: 5000. client sendAllEventsTo: Opentalk.DebuggingCollector. client start. server := client activeBrokerAtHost: 'localhost' port: 42424. numThreads := 10. interval := 12000. clients := (1 to: numThreads) collect: [:i | [ [Transcript show: (server echo: '#'); flush. (Delay forMilliseconds: interval) wait] repeat ] forkAt: 49 ]. clients do:[:each | each terminate]. clients do:[:each | each isUnderDebug ifFalse: [ each terminate ] ]. client stop --- server --- broker := RequestBroker newSRBStstTcpAtPort: 42424. broker objectAdaptor connectionTimeout: 5000. broker sendAllEventsTo: Opentalk.DebuggingCollector. broker start. broker stop ServerTimeoutRequestBroker allInstances do:[:ea | ea stop] _--- New Code ____ ----- server ----- server := RequestBroker newSRBStstTcpAtPort: 4242. server objectAdaptor connectionTimeout: 200. "close connections after 200 ms of inactivity" server start. client := RequestBroker newSRBStstTcpAtPort: 4243. remote := client activeBrokerAt: server accessPoint. "remote proxy to the server broker, brokers can respond to remote #echo:" client start. [ remote ping. "establish a connection to the server" (Delay forMilliseconds: 150) wait. "wait for most of the server timeout period" "install a delay just before the point where we're about to write the request out into the socket" client objectAdaptor when: #sendingPackage:size:in: do: [ :p :s :t | (Delay forMilliseconds: 100) wait ]. "send a remote echo request. the server should attempt to shutdown the connection due to timeout before we get to write the request" remote echo: 1000. ] ensure: [ client stop. server stop ].