%New() /* the default is IPv4 */
SET bhost=##class(%Net.UDP).GetHostAddr("127.0.0.1")
SET outmsg="this is the message to send"
WRITE cobj.Send(outmsg,bhost,3001)
```
以下是
%Init(queue,qm,chan,logfile)
If 'check Quit send.%GetLastError()
//send a unique message
Set check=send.%Put("This is a test message "_$h)
If 'check Quit send.
# 主机地址
`Send()`方法指定目标的二进制地址。这是主机地址的二进制版本。必须使用`GetHostAddr()`方法创建此二进制主机地址,如下所示:
```java
SET client=##class(%Net.UDP).
# build message
msg = ChatClearRequest()
# send message
self.send_request_sync(self.target_vector, msg)
```
基本上,它只是操作和过程之间的传递。
首先用压缩端点标记输出缓冲区中的数据,然后通过对输出缓冲区数据执行 `TCP SEND` 操作来发送此压缩流数据。
小贴士:注意一下各种语言中,对HL7 V2 Segment分隔符的定义,在以下代码示例注释内容有标注,例如:PB使用char(13)+char(10)作为回车换行、Delphi中换行符为#13+#10
代码样例
2.1Java
package hl7.send;
import java.rmi.RemoteException
```
## `%Net.SMTP`的其他属性
`%Net.SMTP`类还具有一些您可能需要的其他属性,具体取决于使用的SMTP服务器:
- `AllowHeaderEncoding`指定`Send()`方法是否对非`ASCII`标头文本进行编码。
这种情况我推荐使用消息传递的第三种方式 Deferred sending,也就是通过Servies接收到的内容构建原Operations的返回消息,如下图:
有关使用deferred sending的例子我会在之后的文章中分享。
/// json.dumps reference
Property tojson As %SYS.Python;
/// Phone number to send SMS to
Property phone As %String [ Required ];
Parameter SETTINGS = "phone:SMS";
Method
; Send job id on TCP device to be read by client
QUIT
client
SET io="|TCP|2"
SET host="127.0.0.1"
OPEN io:(host:^serverport:"M"):200 ;Connect to server
IF ('$TEST
例如:
```java
Set sc=..DeferResponse(.token)
// Send the token out somewhere...
Send a GET request ```http://localhost:52776/Sample/dbAnalysis/global/Errors```.
你可以用下面的代码对该方法进行编码以处理多个目标:
For iTarget=1:1:$L(..TargetConfigNames, ",") { Set tOneTarget=$ZStrip($P(..TargetConfigNames,",",iTarget),"<>W") Continue:""=tOneTarget $$$sysTRACE("Sending
targets=1&productionName=@productionId},Timeout:Basic" ; /// Configuration item to which to send inbound messages.
[ios send](https://raw.githubusercontent.com/grongierisc/Swift-FHIR-Iris/main/img/gif/ios_send.gif)
从门户网站上查询新的活动记录:
现在我们可以看到Toto有两条新的观察和活动消息。
!
正在显示 43 条结果中的 15 条

