公開方法(Public Methods) | |
| String | Descriptor () |
| int | BytesAvailable () |
| boolean | Connected () |
| void | Close () |
| void | Open () |
| byte[] | Read () |
| void | Read (OutputStream binDataIn) throws IOException |
| void | WaitForData (int msTimeOut) |
| 等待當前執行緒有可用的資料 BytesAvailable。當前執行緒會休眠直到收到資料或超時為止。此為阻塞呼叫。 更多... | |
| void | Write (InputStream binReader) throws IOException |
| 從輸入流寫入輸出流。 更多... | |
| void | Write (byte[] dataOut) |
| void | WriteAndWaitForResponse (OutputStream binDataIn, InputStream binDataOut, int responseStartTimeOut, int responseEndTimeOut, String completionToken) throws IOException |
| 將 binDataOut 流資料寫入輸出流,並將接收到的資料返回到 binDataIn 流中。返回的資料是收到的資料或收到的完成標記。等待回應超時後返回。 更多... | |
| byte[] | WriteAndWaitForResponse (byte[] dataOut, int responseStartTimeOut, int responseEndTimeOut, String completionToken) throws IOException |
| 將位元組資料寫入輸出流並返回接收到的資料。返回的資料是接收到的任何資料或收到的完成標記。等待回應超時後返回。 更多... | |
| int com.UniPRT.Sdk.Comm.IComm.BytesAvailable | ( | ) |
Get the number of bytes available to read.
實作於 com.UniPRT.Sdk.Comm.TcpConnection.
被參考於 com.UniPRT.Sdk.Comm.AComm.WaitForData(), 及 com.UniPRT.Sdk.Comm.AComm.WriteAndWaitForResponse().
| void com.UniPRT.Sdk.Comm.IComm.Close | ( | ) |
Close the connection.
實作於 com.UniPRT.Sdk.Comm.TcpConnection.
被參考於 com.UniPRT.Sdk.Json.JsonCommController.JsonConnection.Dispose().
| boolean com.UniPRT.Sdk.Comm.IComm.Connected | ( | ) |
Check if connection is established.
| String com.UniPRT.Sdk.Comm.IComm.Descriptor | ( | ) |
Get the string descriptor of the connection.
實作於 com.UniPRT.Sdk.Comm.TcpConnection.
被參考於 com.UniPRT.Sdk.Json.JsonCommController.CreateMgmtComm(), com.UniPRT.Sdk.Json.JsonComm.Dispose(), 及 com.UniPRT.Sdk.Json.JsonCommController.JsonConnection.JsonConnection().
| void com.UniPRT.Sdk.Comm.IComm.Open | ( | ) |
Open the connection.
實作於 com.UniPRT.Sdk.Comm.TcpConnection.
被參考於 com.UniPRT.Sdk.Json.JsonCommController.JsonConnection.JsonConnection().
| byte [] com.UniPRT.Sdk.Comm.IComm.Read | ( | ) |
Read all available bytes.
實作於 com.UniPRT.Sdk.Comm.TcpConnection.
被參考於 com.UniPRT.Sdk.Comm.AComm.Read(), 及 com.UniPRT.Sdk.Comm.AComm.WriteAndWaitForResponse().
| void com.UniPRT.Sdk.Comm.IComm.Read | ( | OutputStream | binDataIn | ) | throws IOException |
Read all available bytes into the stream passed in.
| binDataIn | Data input stream. |
| IOException |
| void com.UniPRT.Sdk.Comm.IComm.WaitForData | ( | int | msTimeOut | ) |
等待當前執行緒有可用的資料 BytesAvailable。當前執行緒會休眠直到收到資料或超時為止。此為阻塞呼叫。
| [in] | msTimeOut | 在沒有收到資料前返回的毫秒超時。 |
| void com.UniPRT.Sdk.Comm.IComm.Write | ( | byte[] | dataOut | ) |
Write all bytes from the array passed in.
| dataOut | Byte array to write. |
| void com.UniPRT.Sdk.Comm.IComm.Write | ( | InputStream | binReader | ) | throws IOException |
| byte [] com.UniPRT.Sdk.Comm.IComm.WriteAndWaitForResponse | ( | byte[] | dataOut, |
| int | responseStartTimeOut, | ||
| int | responseEndTimeOut, | ||
| String | completionToken | ||
| ) | throws IOException |
將位元組資料寫入輸出流並返回接收到的資料。返回的資料是接收到的任何資料或收到的完成標記。等待回應超時後返回。
| byte[] | 從連接接收到的位元組陣列。 返回的資料是接收到的任何資料或收到的完成標記。 |
| [in] | dataOut | 要寫入連接的來源位元組陣列。 |
| [in] | responseStartTimeOut | 等待接收到第一個資料的超時。從第一個字節開始計時。 |
| [in] | responseEndTimeOut | 沒有新資料接收的超時。從最後一個字節後開始計時。 |
| [in] | completetionToken | 標示預期回應結束的字串標記。如果只是想在寫入資料到連接後等待回應,可以是空字串。 |
| void com.UniPRT.Sdk.Comm.IComm.WriteAndWaitForResponse | ( | OutputStream | binDataIn, |
| InputStream | binDataOut, | ||
| int | responseStartTimeOut, | ||
| int | responseEndTimeOut, | ||
| String | completionToken | ||
| ) | throws IOException |
將 binDataOut 流資料寫入輸出流,並將接收到的資料返回到 binDataIn 流中。返回的資料是收到的資料或收到的完成標記。等待回應超時後返回。
| [out] | binDataIn | 用於存儲從連接接收到的回應的目標流。 |
| [in] | binDataOut | 寫入連接的來源流資料。 |
| [in] | responseStartTimeOut | 等待接收到第一個資料的超時。從第一個字節開始計時。 |
| [in] | responseEndTimeOut | 沒有新資料接收的超時。從最後一個字節後開始計時。 |
| [in] | completetionToken | 標示預期回應結束的字串標記。如果只是想在寫入資料到連接後等待回應,可以是空字串。 |