点击或拖拽改变大小

PipeUdpNet 类

基于UDP/IT通信的管道信息
Pipeline information based on UDP/IT communication
继承层次
SystemObject
  HslCommunication.Core.PipeCommunicationPipe
    HslCommunication.Core.PipePipeTcpNet
      HslCommunication.Core.PipePipeUdpNet

命名空间:  HslCommunication.Core.Pipe
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:12.0.0.0 (12.0.0.0)
语法
public class PipeUdpNet : PipeTcpNet

PipeUdpNet 类型公开以下成员。

构造函数
  名称说明
公共方法PipeUdpNet
实例化一个默认的对象
Instantiate a default object
公共方法PipeUdpNet(String, Int32)
通过指定的IP地址和端口号来实例化一个对象
Instantiate an object with the specified IP address and port number
Top
属性
  名称说明
公共属性AlienSession
当前的异形连接对象,如果设置了异形连接的话,仅用于异形模式的情况使用
The current alien connection object, if alien connection is set, is only used in the case of alien mode
(继承自 PipeTcpNet。)
公共属性CommunicationLock
获取或设置当前管道的线程锁对象,默认是简单的一个互斥锁
Gets or sets the thread lock object of the current pipeline, which defaults to a simple mutex
(继承自 CommunicationPipe。)
公共属性代码示例ConnectTimeOut
获取或设置接收服务器反馈的时间,如果为负数,则不接收反馈
Gets or sets the time to receive server feedback, and if it is a negative number, does not receive feedback
(继承自 PipeTcpNet。)
公共属性DecideWhetherQAMessageFunction
用来决定当前接收的消息是否是问答服务的消息
(继承自 CommunicationPipe。)
公共属性代码示例IpAddress
获取或是设置远程服务器的IP地址,如果是本机测试,那么需要设置为127.0.0.1
Get or set the IP address of the remote server. If it is a local test, then it needs to be set to 127.0.0.1
(继承自 PipeTcpNet。)
公共属性IsPersistentConnection
获取或设置当前的管道是否是长连接,仅对于串口及TCP是有效的,默认都是长连接
(继承自 CommunicationPipe。)
公共属性LocalBinding
获取或设置绑定的本地的IP地址和端口号信息,如果端口设置为0,代表任何可用的端口
Get or set the bound local IP address and port number information, if the port is set to 0, it means any available port
(继承自 PipeTcpNet。)
公共属性代码示例Port
获取或设置服务器的端口号,具体的值需要取决于对方的配置
Gets or sets the port number of the server. The specific value depends on the configuration of the other party.
(继承自 PipeTcpNet。)
公共属性ReceiveCacheLength
获取或设置一次接收时的数据长度,默认2KB数据长度,特殊情况的时候需要调整
Gets or sets the length of data received at a time. The default length is 2KB
公共属性代码示例ReceiveTimeOut
获取或设置接收服务器反馈的时间,如果为负数,则不接收反馈
Gets or sets the time to receive server feedback, and if it is a negative number, does not receive feedback
(继承自 CommunicationPipe。)
公共属性SleepTime
获取或设置在正式接收对方返回数据前的时候,需要休息的时间,当设置为0的时候,不需要休息。
Get or set the time required to rest before officially receiving the data from the other party. When it is set to 0, no rest is required.
(继承自 CommunicationPipe。)
公共属性Socket
获取或设置当前的客户端用于服务器连接的套接字。
Gets or sets the socket currently used by the client for server connection.
(继承自 PipeTcpNet。)
公共属性SocketKeepAliveTime
获取或设置客户端的Socket的心跳时间信息,这个是Socket底层自动实现的心跳包,不基于协议层实现。默认小于0,不开启心跳检测,如果需要开启,设置 60_000 比较合适,单位毫秒
Get or set the heartbeat time information of the Socket of the client. This is the heartbeat packet automatically implemented by the bottom layer of the Socket, not based on the protocol layer. The default value is less than 0, and heartbeat detection is not enabled. If you need to enable it, it is more appropriate to set 60_000, in milliseconds.
(继承自 PipeTcpNet。)
公共属性UseServerActivePush
获取或设置当前的管道是否激活从设备主动推送的功能,设置为 true 时支持主动从设备方接收数据信息
Gets or sets whether the current pipeline activates the function of actively pushing data from the device. If this is set to true, it supports actively receiving data information from the device
(继承自 CommunicationPipe。)
Top
方法
  名称说明
受保护的方法CheckMessageComplete
根据给定的消息,发送的数据,接收到数据来判断是否接收完成报文
(继承自 CommunicationPipe。)
公共方法CloseCommunication
关闭当前的管道信息,返回是否关闭成功的结果对象
(继承自 PipeTcpNet。)
公共方法CloseCommunicationAsync (继承自 PipeTcpNet。)
公共方法Dispose (继承自 CommunicationPipe。)
受保护的方法Dispose(Boolean) (继承自 CommunicationPipe。)
公共方法Equals (继承自 Object。)
受保护的方法Finalize (继承自 Object。)
公共方法GetConnectIPEndPoint
获取当前的远程连接信息,如果端口号设置了可选的数组,那么每次获取对象就会发生端口号切换的操作。
Get the current remote connection information. If the port number is set to an optional array, the port number switching operation will occur every time the object is obtained.
(继承自 PipeTcpNet。)
公共方法GetHashCode (继承自 Object。)
公共方法GetType (继承自 Object。)
受保护的方法IncrConnectErrorCount
自增当前的连续错误计数,并且获取自增后的值信息,最大到10亿为止,无法继续增加了。
(继承自 CommunicationPipe。)
公共方法IsConnectError
当前的管道连接对象是否发生了错误
(继承自 CommunicationPipe。)
受保护的方法MemberwiseClone (继承自 Object。)
公共方法OpenCommunication
打开当前的管道信息,返回是否成功打开的结果对象,并通过属性 Content 指示当前是否为新创建的连接对象,如果是,则该值为 true
(重写 PipeTcpNetOpenCommunication.)
公共方法OpenCommunicationAsync
打开当前的管道信息,返回是否成功打开的结果对象,并通过属性 Content 指示当前是否为新创建的连接对象,如果是,则该值为 true
(重写 PipeTcpNetOpenCommunicationAsync.)
公共方法RaisePipeError
主动引发一个管道错误,从而让管道可以重新打开
(继承自 CommunicationPipe。)
公共方法ReadFromCoreServer
将数据发送到当前的管道里,并从管道接收相关的数据信息,可以指定消息类型,发送数据,是否有数据响应,休眠时间
To send data to the current pipeline and receive relevant data information from the pipeline, you can specify the message type, the data sent, whether there is a data response, and the sleep time
(继承自 CommunicationPipe。)
公共方法ReadFromCoreServerAsync
将数据发送到当前的管道里,并从管道接收相关的数据信息,可以指定消息类型,发送数据,是否有数据响应,休眠时间
To send data to the current pipeline and receive relevant data information from the pipeline, you can specify the message type, the data sent, whether there is a data response, and the sleep time
(继承自 CommunicationPipe。)
受保护的方法ReadFromCoreServerHelper
将数据发送到当前的管道里,并从管道接收相关的数据信息,可以指定消息类型,发送数据,是否有数据响应,休眠时间
To send data to the current pipeline and receive relevant data information from the pipeline, you can specify the message type, the data sent, whether there is a data response, and the sleep time
(继承自 CommunicationPipe。)
受保护的方法ReadFromCoreServerHelperAsync
将数据发送到当前的管道里,并从管道接收相关的数据信息,可以指定消息类型,发送数据,是否有数据响应,休眠时间
To send data to the current pipeline and receive relevant data information from the pipeline, you can specify the message type, the data sent, whether there is a data response, and the sleep time
(继承自 CommunicationPipe。)
公共方法Receive(Int32, Int32, ActionInt64, Int64)
从管道里,接收指定长度的报文数据信息,如果长度指定为-1,表示接收不超过2048字节的动态长度。另外可以指定超时时间,进度报告等
Receives the packet data of a specified length from the pipe. If the length is set to -1, it indicates that the dynamic length of the packet is not more than 2048 bytes. You can also specify timeouts, progress reports, etc
(继承自 CommunicationPipe。)
公共方法Receive(Byte, Int32, Int32, Int32, ActionInt64, Int64)
接收固定长度的字节数组,允许指定超时时间,默认为60秒,当length大于0时,接收固定长度的数据内容,当length小于0时,buffer长度的缓存数据
Receiving a fixed-length byte array, allowing a specified timeout time. The default is 60 seconds. When length is greater than 0, fixed-length data content is received. When length is less than 0, random data information of a length not greater than 2048 is received.
(重写 PipeTcpNetReceive(Byte, Int32, Int32, Int32, ActionInt64, Int64).)
公共方法ReceiveAsync(Int32, Int32, ActionInt64, Int64)
从管道里,接收指定长度的报文数据信息,如果长度指定为-1,表示接收不超过2048字节的动态长度。另外可以指定超时时间,进度报告等
Receives the packet data of a specified length from the pipe. If the length is set to -1, it indicates that the dynamic length of the packet is not more than 2048 bytes. You can also specify timeouts, progress reports, etc
(继承自 CommunicationPipe。)
公共方法ReceiveAsync(Byte, Int32, Int32, Int32, ActionInt64, Int64)
接收固定长度的字节数组,允许指定超时时间,默认为60秒,当length大于0时,接收固定长度的数据内容,当length小于0时,buffer长度的缓存数据
Receiving a fixed-length byte array, allowing a specified timeout time. The default is 60 seconds. When length is greater than 0, fixed-length data content is received. When length is less than 0, random data information of a length not greater than 2048 is received.
(重写 PipeTcpNetReceiveAsync(Byte, Int32, Int32, Int32, ActionInt64, Int64).)
公共方法ReceiveMessage(INetMessage, Byte, Boolean, ActionInt64, Int64, ActionByte)
包含了一个复杂的逻辑,从管道里根据当前的消息格式定义,接收报文信息,这个报文可能是来自服务器主动推送的。具体可以通过参数 useActivePush 来特殊控制。
Contains a complex logic from the pipeline, according to the current message format definition, to receive message information, this message may be actively pushed from the server. The parameter useActivePush can be used for special control.
(重写 CommunicationPipeReceiveMessage(INetMessage, Byte, Boolean, ActionInt64, Int64, ActionByte).)
公共方法ReceiveMessage(INetMessage, Byte, Byte, ActionByte, Boolean)
包含了一个复杂的逻辑,从管道里根据当前的消息格式定义,接收报文信息,这个报文可能是来自服务器主动推送的。具体可以通过参数 useActivePush 来特殊控制。
Contains a complex logic from the pipeline, according to the current message format definition, to receive message information, this message may be actively pushed from the server. The parameter useActivePush can be used for special control.
公共方法ReceiveMessageAsync
包含了一个复杂的逻辑,从管道里根据当前的消息格式定义,接收报文信息,这个报文可能是来自服务器主动推送的。具体可以通过参数 useActivePush 来特殊控制。
Contains a complex logic from the pipeline, according to the current message format definition, to receive message information, this message may be actively pushed from the server. The parameter useActivePush can be used for special control.
(重写 CommunicationPipeReceiveMessageAsync(INetMessage, Byte, Boolean, ActionInt64, Int64, ActionByte).)
公共方法ResetConnectErrorCount
重置当前的连续错误计数为0,并且返回重置前时候的值
(继承自 CommunicationPipe。)
公共方法Send(Byte)
发送数据到当前的管道中去
Send data to the current pipe
(继承自 CommunicationPipe。)
公共方法Send(Byte, Int32, Int32)
将一个数据缓存中的指定的部分字段,发送到当前的管道中去
Sends the specified partial field from a data cache to the current pipeline
(重写 PipeTcpNetSend(Byte, Int32, Int32).)
公共方法SendAsync(Byte)
发送数据到当前的管道中去
Send data to the current pipe
(继承自 CommunicationPipe。)
公共方法SendAsync(Byte, Int32, Int32)
将一个数据缓存中的指定的部分字段,发送到当前的管道中去
Sends the specified partial field from a data cache to the current pipeline
(重写 PipeTcpNetSendAsync(Byte, Int32, Int32).)
受保护的方法SetBufferQA
设置当前的问答状态下的缓存数据
(继承自 CommunicationPipe。)
公共方法SetMultiPorts
设置多个可选的端口号信息,例如在三菱的PLC里,支持配置多个端口号,当一个网络发生异常时,立即切换端口号连接读写,提升系统的稳定性
Set multiple optional port number information. For example, in Mitsubishi PLC, it supports to configure multiple port numbers. When an abnormality occurs in a network, the port number is immediately switched to connect to read and write to improve the stability of the system.
(继承自 PipeTcpNet。)
公共方法StartReceiveBackground
开始后台接收相关的报文数据,当UseServerActivePush为True时,则使用本方法
(继承自 PipeTcpNet。)
公共方法ToString (重写 PipeTcpNetToString.)
Top
字段
  名称说明
受保护的字段autoResetEvent
当启用设备方主动发送数据时,用于同步访问方法的信号同步功能
(继承自 CommunicationPipe。)
受保护的字段bufferQA
当启用设备方主动发送数据时,用于应答服务机制的数据缓存
(继承自 CommunicationPipe。)
受保护的字段isPersistentConn
是否是长连接的状态
Whether it is a long connection state
(继承自 CommunicationPipe。)
Top
扩展方法
  名称说明
公共扩展器方法ToJsonString
获取当前对象的JSON格式表示的字符串。
Gets the string represented by the JSON format of the current object.
(由 HslExtension 定义。)
Top
参见