File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,37 @@ public void SingleResponderSendsCorrectMessagesToMultipleRequestors()
176
176
}
177
177
}
178
178
179
+ [ Theory ]
180
+ [ InlineData ( false ) ]
181
+ [ InlineData ( true ) ]
182
+ public void ReplyIsForLatestRequestIfRelaxedAndCorrelateEnabled ( bool correlate )
183
+ {
184
+ using ( var rep = new ResponseSocket ( ) )
185
+ using ( var req = new RequestSocket ( ) )
186
+ {
187
+ var port = rep . BindRandomPort ( $ "tcp://127.0.0.1") ;
188
+
189
+ req . Connect ( $ "tcp://127.0.0.1:{ port } ") ;
190
+ req . Options . Correlate = correlate ;
191
+ req . Options . Relaxed = true ;
192
+
193
+ req . SendFrame ( "Request1" ) ;
194
+ req . SendFrame ( "Request2" ) ;
195
+
196
+ rep . SendFrame ( rep . ReceiveFrameString ( ) ) ;
197
+ rep . SendFrame ( rep . ReceiveFrameString ( ) ) ;
198
+
199
+ if ( correlate )
200
+ {
201
+ Assert . Equal ( "Request2" , req . ReceiveFrameString ( ) ) ;
202
+ }
203
+ else
204
+ {
205
+ Assert . Equal ( "Request1" , req . ReceiveFrameString ( ) ) ;
206
+ }
207
+ }
208
+ }
209
+
179
210
internal void RouterBounce ( ref RouterSocket router )
180
211
{
181
212
bool more ;
You can’t perform that action at this time.
0 commit comments