Terminating a GPRS connection

Earlier I have posted an article on establishing a GPRS/EVDO/EDGE connection with TcpClient in managed code. The post generated a number of questions from users and one of the common questions was that the code works them, but the connection remains open after the request has been closed. This is the behavior of Connection Manager,…

0

SerialPort issue transmitting Unicode characters

The managed implementation in .NET Framework 2.0 and .NET Compact Framework 2.0 supports the Encoding property that allows developers to specify the encoding they would use to transmit data over a serial port connection. The property defaults to ASCIIEncoding, which only allows ASCII characters to be transmitted. To transmit non-ASCII Unicode characters over the wire,…

1

MessageBox issue

On NETCF V2, a message box is automatically closed if MessageBox.Show() is called after a form is closed. This is different behavior from NETCF V1 and Desktop (V1/V2). To work around the issue, simply call Message.Show() on another thread with codes like this: In the Main() function, add the following lines after Application.Run():            Thread t…

0

Establish a GPRS connection with TcpClient

NETCF’s HttpWebRequest automatically sets up a GPRS connection for web requests/web services when a wired/wi-fi connection is not available. Therefore, when you do a web request or consume a web service, developers do not need special coding to handle the GPRS connection case. This does not apply to lower level socket classes like TcpClient and…

3

Deadlock issue on closing SerialPort

NETCF V2’s SerialPort implementation provides four public events for developers. They can add custom event handlers to handle these events. Since these event handlers are executed by ThreadPool threads, if the developer wants to update form fields with the received data, he/she would need to invoke the associated methods on the form to ask the GUI…

1

Directory.Exists() Issue

On Windows CE 4.X based devices, Directory.Exists() treats path names ending with a slash “\” differently. As an example, Directory.Exists(“\\temp”) will return true if the “temp” directory exists. However, the following call will return false even though the directory exists: Directory.Exists(“\\temp\\”) On Windows Mobile 5.0 devices, NETCF’s behavior is consistent with Desktop’s; that is, Directory.Exists()…

0

Unhandled exception with serial port issue

When an exception is unhandled in an application, an unhandled exception dialog is shown to inform the user of the issue. Because of an issue in some serial port drivers, when an unhandled exception occurs and the user exits the application, the application is not actually closed if a serial port instance is open. However, this…

1