SocketClientConnection

SocketClientConnection主要是用于在Socket通讯中客户端与服务端的连接,保证客户端发送的报文可以被服务端接收并且可以接收到服务端返回的信息。

连接配置

  • SocketClientConnection插件所在位置:lib==>be-esb-plugin-base-2.0.jar==>com==>brilliance==>eibs==>core==>service==>instance==>impl==>SocketClientConnection
  • 该类继承AbsConnection连接插件共同父类
  • 连接插件需要配置在commons.xml文件的connections中
属性 描述 值类型 示例
ip 指定连接的ip地址 string 127.0.0.1
port 指定连接端口 Int 10018
send_timeout 发送超时时间,为0则不限时间,单位ms long 20000
receive_timeout 接收超时时间,为0则不限时间,单位ms long 0

配置实例

  • 实际连接配置
<connection class="SocketClientConnection" id="socketClientConnection"/>
  • 实际使用配置
<!--配置socket连接信息并在service.xml中进行注册-->
<connection ref="socketClientConnection"><!--指定相应的连接插件-->
    <property name="ip" value="127.0.0.1" /><!--指定连接的服务端ip地址-->
    <property name="port" value="10018" /><!--指定连接的端口号-->
    <property name="send_timeout" value="20000" /><!--发送超时时间,为0则不限时间,单位ms-->
    <property name="receive_timeout" value="0" /><!--接收超时时间-->
</connection>

results matching ""

    No results matching ""