ConnectionSendAndWaitForValidResponse Method (BinaryWriter, BinaryReader, Int32, Int32, ResponseValidator)
|
Sends data from sourceStream and writes the response data to destinationStream.
Namespace:
Zebra.Sdk.Comm
Assembly:
SdkApi.Core (in SdkApi.Core.dll) Version: 2.15.2634
Syntax void SendAndWaitForValidResponse(
BinaryWriter destinationStream,
BinaryReader sourceStream,
int initialResponseTimeout,
int responseCompletionTimeout,
ResponseValidator validator
)
Sub SendAndWaitForValidResponse (
destinationStream As BinaryWriter,
sourceStream As BinaryReader,
initialResponseTimeout As Integer,
responseCompletionTimeout As Integer,
validator As ResponseValidator
)
void SendAndWaitForValidResponse(
BinaryWriter^ destinationStream,
BinaryReader^ sourceStream,
int initialResponseTimeout,
int responseCompletionTimeout,
ResponseValidator^ validator
)
Parameters
- destinationStream
- Type: System.IOBinaryWriter
Destination for response. - sourceStream
- Type: System.IOBinaryReader
Source of data to be sent. - initialResponseTimeout
- Type: SystemInt32
The maximum time, in milliseconds, to wait for the initial response to be received.
If no data is received during this time, the function does not write any data to the destination stream. - responseCompletionTimeout
- Type: SystemInt32
After the initial response, if no data is received for this period of time, the
input is considered complete and the method returns. - validator
- Type: Zebra.Sdk.CommResponseValidator
If the response satisfies this validator, the input is considered complete and the method returns.
May be used to avoid waiting for more data when the response follows a known format.If validator is null, no validation is performed.
When performing validation, this method will use enough memory to hold the entire response.
Exceptions Remarks
The software returns immediately if the data received satisfies validator. The connection must be open before this method is called.
If sendAndWaitForResponse is called when a connection is closed, a ConnectionException is thrown.
See Also