Interface to a communication connection 更多...
Public 成员函数 | |
| void | Close () |
| Closes a connection. | |
| void | Open () |
| Opens a connection. | |
| byte[] | Read () |
| Read all bytes available. | |
| void | Read (BinaryWriter binDataIn) |
| Reads all bytes available into the stream passed in. | |
| void | WaitForData (int msTimeOut) |
| 等待数据可用 BytesAvailable 在当前线程。当前线程休眠直到接收到数据或超时。阻塞调用。 更多... | |
| void | Write (BinaryReader binReader) |
| 从输入流写入输出流 更多... | |
| void | Write (byte[] dataOut) |
| Writes all bytes from the array passed in. | |
| void | WriteAndWaitForResponse (BinaryWriter binDataIn, BinaryReader binDataOut, int responseStartTimeOut, int responseEndTimeOut, string completetionToken) |
| 将 binDataOut 流数据写入输出流,并将接收到的数据返回到 binDataIn 流中。返回的数据是接收到的任何数据或达到接收的完成标记。如果没有响应则在返回前等待超时。 更多... | |
| byte[] | WriteAndWaitForResponse (byte[] dataOut, int responseStartTimeOut, int responseEndTimeOut, string completetionToken) |
| 将字节数据写入输出流并返回接收到的数据。返回的数据是接收到的任何数据或达到接收的完成标记。在返回前等待响应超时。 更多... | |
属性 | |
| int | BytesAvailable [get] |
| Number of bytes available to read. This is estimate and number can change as data is received. | |
| bool | Connected [get] |
| true if connection is established | |
| string | Descriptor [get] |
| string descriptor of the connection. | |
Interface to a communication connection
TODO Raul: Should add use of "Pipes" for more efficient I/O operations. e.g. "demultiplexer" (single input to multiple outputs) for input to have multiple "listeners" to data received.
| void UniPRT.Sdk.Comm.IComm.WaitForData | ( | int | msTimeOut | ) |
等待数据可用 BytesAvailable 在当前线程。当前线程休眠直到接收到数据或超时。阻塞调用。
| [in] | msTimeOut | 如果未接收到数据则在返回前的毫秒超时时间。 |
在 UniPRT.Sdk.Comm.AComm 内被实现.
| void UniPRT.Sdk.Comm.IComm.Write | ( | BinaryReader | binReader | ) |
| void UniPRT.Sdk.Comm.IComm.WriteAndWaitForResponse | ( | BinaryWriter | binDataIn, |
| BinaryReader | binDataOut, | ||
| int | responseStartTimeOut, | ||
| int | responseEndTimeOut, | ||
| string | completetionToken | ||
| ) |
将 binDataOut 流数据写入输出流,并将接收到的数据返回到 binDataIn 流中。返回的数据是接收到的任何数据或达到接收的完成标记。如果没有响应则在返回前等待超时。
| [out] | binDataIn | 目标流以存储从连接接收到的响应。 |
| [in] | binDataOut | 要写入连接的源流数据。 |
| [in] | responseStartTimeOut | 等待接收到第一个数据的超时时间(毫秒)。第一个字节的时间。 |
| [in] | responseEndTimeOut | 没有接收到新数据的超时时间(毫秒)。最后一个字节后的时间。 |
| [in] | completetionToken | 指示预期响应结束的字符串标记。如果只是想等待写入数据后的响应,可以是空字符串。 |
在 UniPRT.Sdk.Comm.AComm 内被实现.
| byte [] UniPRT.Sdk.Comm.IComm.WriteAndWaitForResponse | ( | byte[] | dataOut, |
| int | responseStartTimeOut, | ||
| int | responseEndTimeOut, | ||
| string | completetionToken | ||
| ) |
将字节数据写入输出流并返回接收到的数据。返回的数据是接收到的任何数据或达到接收的完成标记。在返回前等待响应超时。
| byte[] | 从连接接收到的字节数组。 返回的数据是接收到的任何数据或达到完成标记时的数据。 |
| [in] | dataOut | 要写入连接的源字节数组。 |
| [in] | responseStartTimeOut | 等待接收到第一个数据的超时时间(毫秒)。第一个字节的时间。 |
| [in] | responseEndTimeOut | 没有接收到新数据的超时时间(毫秒)。最后一个字节后的时间。 |
| [in] | completetionToken | 指示预期响应结束的字符串标记。如果只是想等待写入数据后的响应,可以是空字符串。 |
在 UniPRT.Sdk.Comm.AComm 内被实现.