Nate Bross
Well-known member
Hi Guys:
I have an interesting delima. I am trying to send data over a network, the data I am sending contains UNICODE values, but the recieving end needs to get the ASCII value of each byte.
I have a server and client. The client sends data to the server and when it gets there it comes out as "?" question marks.
Server Recieval Code:
Client Code:
I have an interesting delima. I am trying to send data over a network, the data I am sending contains UNICODE values, but the recieving end needs to get the ASCII value of each byte.
I have a server and client. The client sends data to the server and when it gets there it comes out as "?" question marks.
Server Recieval Code:
Code:
Dim networkStream As NetworkStream = objTCPClient.GetStream()
Read the stream into a byte array
Dim bytes(objTCPClient.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt(objTCPClient.ReceiveBufferSize))
Return the data received from the client to the console.
Dim ClientData As String = Encoding.ASCII.GetString(bytes)
Call OwningForm.DebugText(("Client " & sKey & "> " & ClientData))
Call OwningForm.ProcessIncomingTCP(ClientData, sKey)
Dim responseString As String = "Recieved."
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(responseString)
networkStream.Write(sendBytes, 0, sendBytes.Length)
Call OwningForm.DebugText(("Server Sent> " & responseString))
Client Code:
Code:
Message = "BIN@