Hi,

I need help reading data from TCP in Universal Windows.
I have tried with the following code without luck.

Code:
    Public Async Sub Receive()
        Try
            Dim message As String
            Using inputStream As Stream = _socket.InputStream.AsStreamForRead()
                Using streamReader As New StreamReader(inputStream, Encoding.Unicode)
                    message = Await streamReader.ReadLineAsync()
                End Using
            End Using


            RaiseEvent OnReceived(_socket, message)

            Receive()
        Catch x As Exception
            RaiseEvent OnException(Me, x)
        End Try
    End Sub
My server is a classic Windows application
The following code to send from the server
Code:
        Public Sub Send(ByVal Messsage As String)
            sendMessage = New StreamWriter(listClient.GetStream)
            sendMessage.WriteLine(Messsage)
            sendMessage.Flush()
        End Sub
In a classic Windows client app there is problem reading
Code:
    Sub ReadFromServer(ByVal ar As IAsyncResult)
        Try
            xUpdate(New StreamReader(client.GetStream).ReadLine)
            client.GetStream.BeginRead(New Byte() {0}, 0, 0, AddressOf ReadFromServer, Nothing)

        Catch ex As Exception
            xUpdate("You have disconnecting from server")
            Exit Sub
        End Try
    End Sub
Thank you in advance,
Henrik