使用 TCP/IP 连接向应用程序发送消息。
action='SOCKET port=windowname[;host=hostname][;sendText=text][;recvText=text[;timeout=seconds]]'
SOCKET 命令用于将动态信息传递到运行中的应用程序,以及将消息集成到 Java 应用程序和 Visual Basic 应用程序中。这两种语言都不支持自定义窗口消息传送,eMbedded Visual Basic 不支持命令行参数。
要连接到套接字,必须指定端口和主机。使用 sendText 输入消息。
确认应用程序已成功接收 sendText 时,使用 recvText 显示消息。使用 recvText 时,可以指定超时限制。如果监听器在超时限制内无法连接、发送确认或接收确认,则操作失败。
以下示例将 $sender=$message 中的字符串转发到正在监听端口 12345 的本地应用程序。监听器预计应用程序在 5 秒内发送 "beeperAck" 作为确认。
dblsn -l "action='socket port=12345; sendText=$sender=$message; recvText=beeperAck; timeout=5'" |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |