T
Tomer
Hi,
I've used the Wintalk sample in order to write a pocket pc client application that sends data to a server through a GPRS connection.
I'm sending the contents of a table, so I have a loop that runs on the table and sends for each row a string through the socket.
About 1 out of 3 times the application get stuck entirely during this loop.
When I'm work on WLAN everything work just fine.
I've tried 3 different ways the send the data through the socket but got the same result.
Here's the code:
(blocking is set to true)
public void SendData(String Data)
{
// ========== one way
SendDataBytes = Encoding.ASCII.GetBytes(Data.ToCharArray());
stream.Write(SendDataBytes,0,SendDataBytes.Length);
stream.Flush();
Thread.Sleep(this.delayBetweenTransmittions); // little delay between sends
// ========== another way that 'worked' the same way
SendDataBytes = Encoding.ASCII.GetBytes(Data.ToCharArray());
socket.Send(SendDataBytes,SendDataBytes.Length,SocketFlags.None);
Thread.Sleep(this.delayBetweenTransmittions); // little delay between sends
// =========== 3rd way that 'worked' the same way
writer.Write(Data);
writer.Flush();
Thread.Sleep(this.delayBetweenTransmittions); // little delay between sends
}
Please help!
Tomer.
I've used the Wintalk sample in order to write a pocket pc client application that sends data to a server through a GPRS connection.
I'm sending the contents of a table, so I have a loop that runs on the table and sends for each row a string through the socket.
About 1 out of 3 times the application get stuck entirely during this loop.
When I'm work on WLAN everything work just fine.
I've tried 3 different ways the send the data through the socket but got the same result.
Here's the code:
(blocking is set to true)
public void SendData(String Data)
{
// ========== one way
SendDataBytes = Encoding.ASCII.GetBytes(Data.ToCharArray());
stream.Write(SendDataBytes,0,SendDataBytes.Length);
stream.Flush();
Thread.Sleep(this.delayBetweenTransmittions); // little delay between sends
// ========== another way that 'worked' the same way
SendDataBytes = Encoding.ASCII.GetBytes(Data.ToCharArray());
socket.Send(SendDataBytes,SendDataBytes.Length,SocketFlags.None);
Thread.Sleep(this.delayBetweenTransmittions); // little delay between sends
// =========== 3rd way that 'worked' the same way
writer.Write(Data);
writer.Flush();
Thread.Sleep(this.delayBetweenTransmittions); // little delay between sends
}
Please help!
Tomer.