Hola,
Tengo el siguiente código de prueba, pero quiero enviar un fichero de texto que debo leer de un directorio, como se procedería?
Gracias.
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim ws As New System.Net.WebSockets.ClientWebSocket
Dim Cws As New System.Threading.CancellationToken
Dim myUri As New Uri("wss://echo.websocket.org/")
Dim Cadena As String
Dim EnvioByte(3) As Byte
Dim Matriz(3) As String
Dim segment As New ArraySegment(Of Byte)(EnvioByte)
Matriz(0) = "0"
Matriz(1) = "1"
Matriz(3) = "2"
EnvioByte(0) = Convert.ToByte(Matriz(0))
EnvioByte(1) = Convert.ToByte(Matriz(1))
EnvioByte(2) = Convert.ToByte(Matriz(2))
ws.ConnectAsync(myUri, Cws)
ws.SendAsync(segment, Net.WebSockets.WebSocketMessageType.Text, False, Cws)
'Cadena = ws.ReceiveAsync()
MsgBox(Cadena)
End Sub