コード例 #1
0
        /// Return the next message sent by the receiver, or, after
        /// <paramref name="timeout"/> has passed, return <c>null</c>.
        public virtual byte[] Get(double timeout = 0.1)
        {
            EnsureSocketConnected();

            int microsecondTimeout = (int)(timeout * 1000000);

            if (commandSocket.Poll(microsecondTimeout, SelectMode.SelectRead))
            {
                byte[] headerBytes = new byte[16];
                commandSocket.Receive(headerBytes);

                Header header = EiscpPacket.ParseHeader(headerBytes);

                byte[] message = new byte[header.messageSize];
                commandSocket.Receive(message);

                return(IscpMessage.Parse(message));
            }

            return(null);
        }
コード例 #2
0
ファイル: Core.cs プロジェクト: miracle2k/onkyo-eiscp-dotnet
 public EiscpPacket(IscpMessage iscpMessage)
     : this(iscpMessage.Bytes)
 {
 }
コード例 #3
0
 public EiscpPacket(IscpMessage iscpMessage) :
     this(iscpMessage.Bytes)
 {
 }