Hi there.
For the past three weeks I'm struggling with this.
I use an asynchronous method to send data from my client to server.
The Sender is:
Object objData = finMess;
byte[] byData = System.Text.Encoding.Default.GetBytes(ob...
if (m_clientSocket != null)
{
m_clientSocket.Send(byData);
}
with finMess ( a predifined string) with a value as 99984. But it only sends through "999".
The Recevier's code is:
int iRx = 0;
// Complete the BeginReceive() asynchronous call by EndReceive() method
// which will return the number of characters written to the stream
// by the client
iRx = socketData.m_currentSocket.EndReceive(as...
char[] chars = new char[iRx + 1];
System.Text.Decoder d = System.Text.Encoding.Default.GetDecoder(...
int charLen = d.GetChars(socketData.dataBuffer,
0, iRx, chars, 0);
System.String szData = new System.String(chars);
Then I append szData and take it in a String.
But the value only comes out as "999".
I use sockets for this. A worker_socket and a client_socket.
Can anyone with the expertise PLEASE HELP?
Thanks!
Tags: