Chapter 8. Communications Using TCP/IP: HTTP and SocketsWindows CE provides a rich variety of communications techniques for transferring data between a Windows CE device and desktop PCs or servers. Selecting the most appropriate communications technique is important. If you are developing a "companion" application (that is, an application that shares data with a desktop application, in the same way that Pocket Word and Word for Windows share data), you should use either ActiveSync (see Chapter 17), or perhaps RAPI (the Remote Application Programming Interface, see Chapter 10). If your application needs to communicate directly with another application running on a desktop PC or server, you should consider using TCP/IP (Transmission Control Protocol/Internet Protocol) sockets. Sockets can also be used for communicating with other compatible devices using infrared. Finally, if you need to transfer data to and from a server (for example, data from a server-based database), HTTP (HyperText Transfer Protocol) can be used. TCP/IP sockets and HTTP are the subject of this chapter. TCP/IP is now the most widely used network protocol and is the only protocol supported as standard with Windows CE. TCP/IP communications techniques provide the widest possible connection options, including the following:
The solutions possible with TCP/IP communications are endless, including the following:
One of the most difficult issues to address is keeping data on a Windows CE device synchronized with data on a remote server or PC. Windows CE devices are typically connected for brief periods of time and are, for the most part, disconnected from the network. ActiveSync (see Chapter 17) deals with this issue elegantly, but can only be used effectively with a desktop PC, and this desktop PC can only be used to synchronize a limited number of Windows CE devices. If you are downloading data from, say, an enterprise database, you will need to factor into your designs how to store the data locally and how to synchronize data changes.
|