ConnectionA.SendAndWaitForValidResponse Method (Byte[], Int32, Int32, ResponseValidator)
|
Sends dataToSend and returns the response data.
Namespace:
Zebra.Sdk.Comm
Assembly:
SdkApi_Core (in SdkApi_Core.dll) Version: 2.14.1989
Syntaxpublic virtual byte[] SendAndWaitForValidResponse(
byte[] dataToSend,
int initialResponseTimeout,
int responseCompletionTimeout,
ResponseValidator validator
)
Public Overridable Function SendAndWaitForValidResponse (
dataToSend As Byte(),
initialResponseTimeout As Integer,
responseCompletionTimeout As Integer,
validator As ResponseValidator
) As Byte()
public:
virtual array<unsigned char>^ SendAndWaitForValidResponse(
array<unsigned char>^ dataToSend,
int initialResponseTimeout,
int responseCompletionTimeout,
ResponseValidator^ validator
)
Parameters
- dataToSend
- Type:System.Byte[]
Byte array of data to send - initialResponseTimeout
- Type: System.Int32
The maximum time, in milliseconds, to wait for the initial response to be received.
If no data is received during this time, the function returns a zero length array. - responseCompletionTimeout
- Type: System.Int32
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.Comm.ResponseValidator
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.
Return Value
Type:
Byte[]received data
Implements
Connection.SendAndWaitForValidResponse(Byte[], Int32, Int32, ResponseValidator)
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