示例#1
0
        private async Task ReceiveRaspberryPiInfraredSensorSignal()
        {
            var socket = new CSignalReceivingTcpSocket();
            await socket.ConnectAsync("10.120.3.13", 5005);

            await socket.ReceiveSignalAsync();

            socket.Disconnect();
        }
    private async Task TestSignalReceivingTcpSocketAsync()
    {
        try
        {
            var kSocket = new CSignalReceivingTcpSocket();
            await kSocket.ConnectAsync(ServerApplicationIpv4Text.text, ServerApplicationPortNumber);

            await kSocket.ReceiveSignalAsync();

            kSocket.Disconnect();
            Interlocked.Exchange(ref m_strText, "Connected, received signal, and disconnected from the destined server application.");
        }
        catch (Exception kException)
        {
            Interlocked.Exchange(ref m_strText, kException.Message);
        }
    }