C
cyberco
Using: WM5 PPC, .NetCF2.0, OpenNetCF
Somehow I was cheering too early. After a while the snippet below
stopped working and I'm at a loss why. During the first few runs this
snippet nicely connected to the GPRS network: the 'connecting...'
balloon popped up and everything went fine from there. But now the
'connMgr.Status' never becomes 'ConnectionStatus.Connected' and a
timeout occurs. Standby, rebooting, nothing solves this problem.
When connected via ActiveSync the snippet below works fine IF I set the
'exclusive' parameter to 'true'.
I also tried adding a 'Guid' as a parameter,
connMgr.Connect(guid,false, ConnectionMode.Asynchronous), but the
result was that the connection (popping up the balloon) was made only
once. After that the balloon stayed away and the connection was never
made.
Could it be that the connection manager is unable to start a new
connection if it has started one already in the past? In that case I
would say that the a complete reboot of the phone should solve the
problem, but it doesn't.
=============================
bool connected = false;
int timeOut = 20; //seconds
ConnectionManager connMgr = new ConnectionManager();
//connMgr.Connect(true, ConnectionMode.Asynchronous);
connMgr.Connect(false, ConnectionMode.Asynchronous);
while (!connected) {
if (connMgr.Status != ConnectionStatus.Connected) {
Thread.Sleep(1000);
if (timeOut == 0) {
return;
}
timeOut -= 1;
continue;
}
connected = true;
}
=============================
Somehow I was cheering too early. After a while the snippet below
stopped working and I'm at a loss why. During the first few runs this
snippet nicely connected to the GPRS network: the 'connecting...'
balloon popped up and everything went fine from there. But now the
'connMgr.Status' never becomes 'ConnectionStatus.Connected' and a
timeout occurs. Standby, rebooting, nothing solves this problem.
When connected via ActiveSync the snippet below works fine IF I set the
'exclusive' parameter to 'true'.
I also tried adding a 'Guid' as a parameter,
connMgr.Connect(guid,false, ConnectionMode.Asynchronous), but the
result was that the connection (popping up the balloon) was made only
once. After that the balloon stayed away and the connection was never
made.
Could it be that the connection manager is unable to start a new
connection if it has started one already in the past? In that case I
would say that the a complete reboot of the phone should solve the
problem, but it doesn't.
=============================
bool connected = false;
int timeOut = 20; //seconds
ConnectionManager connMgr = new ConnectionManager();
//connMgr.Connect(true, ConnectionMode.Asynchronous);
connMgr.Connect(false, ConnectionMode.Asynchronous);
while (!connected) {
if (connMgr.Status != ConnectionStatus.Connected) {
Thread.Sleep(1000);
if (timeOut == 0) {
return;
}
timeOut -= 1;
continue;
}
connected = true;
}
=============================