/// <summary> /// 使用指定的容量初始化缓存数据块 /// </summary> /// <param name="capacity">初始化的容量</param> public SoftBuffer(int capacity) { buffer = new byte[capacity]; this.capacity = capacity; hybirdLock = new SimpleHybirdLock( ); byteTransform = new RegularByteTransform( ); }
/// <summary> /// 实例化一个mc协议的服务器 /// </summary> public MelsecMcServer( ) { // 共计使用了五个数据池 xBuffer = new SoftBuffer(DataPoolLength); yBuffer = new SoftBuffer(DataPoolLength); mBuffer = new SoftBuffer(DataPoolLength); dBuffer = new SoftBuffer(DataPoolLength * 2); wBuffer = new SoftBuffer(DataPoolLength * 2); WordLength = 1; ByteTransform = new RegularByteTransform( ); }
/// <summary> /// LSisServer /// </summary> public LSisServer() { pBuffer = new SoftBuffer(DataPoolLength); qBuffer = new SoftBuffer(DataPoolLength); mBuffer = new SoftBuffer(DataPoolLength); dBuffer = new SoftBuffer(DataPoolLength); WordLength = 2; ByteTransform = new RegularByteTransform(); serialPort = new SerialPort(); }
/// <summary> /// LSisServer /// </summary> public LSisServer() { pBuffer = new SoftBuffer(DataPoolLength); qBuffer = new SoftBuffer(DataPoolLength); mBuffer = new SoftBuffer(DataPoolLength); dBuffer = new SoftBuffer(DataPoolLength); WordLength = 2; ByteTransform = new RegularByteTransform(); #if !NETSTANDARD2_0 serialPort = new SerialPort(); #endif }
/// <summary> /// 使用默认的大小初始化缓存空间 /// </summary> public SoftBuffer( ) { buffer = new byte[capacity]; hybirdLock = new SimpleHybirdLock( ); byteTransform = new RegularByteTransform( ); }
public RegularByteTransformTest( ) { byteTransform = new RegularByteTransform( ); }
/// <summary> /// constructor /// </summary> public ByteTransformHelperTest( ) { byteTransform = new RegularByteTransform( ); }