Network Communication

[Previous] [Next]

Many services are stand-alone applications that sit on a single machine and monitor various actions. Here are some services that ship with Windows:

  • Uninterruptible Power Supply Responds to notifications from a UPS device in the case of a power failure
  • Indexing Service Monitors changes to files on your hard disk so that it can update a master catalog, allowing for fast searches
  • Windows Installer Manages the installation, repair, and removal of software on the machine
  • RunAs Service Allows a user to run an application using a different security context
  • Task Scheduler Spawns applications at specific times

None of the services just mentioned require any network communication, but many services do. Here are some examples of network-aware services that ship with Windows:

  • Event Log Sends requested event log records to remote machines, allowing for remote administration
  • NetMeeting Remote Desktop Sharing Allows remote users to view and control your machine's desktop by using Microsoft NetMeeting
  • Server Allows remote users to access shared folders, printers, and named pipes
  • Workstation Allows your machine to remotely connect to another machine's shared folders, printers, and named pipes

If your service requires network communication, you have many mechanisms available to you:

  • Mailslot Allows one-way interprocess communication (IPC) of untyped data between machines running Windows
  • Named pipe Allows two-way interprocess communication of untyped data between machines running Windows
  • Socket Allows two-way interprocess communication of untyped data between machines running any operating system that supports sockets
  • Remote Procedure Call (RPC) Allows two-way interprocess communication of typed data between machines running any operating system that supports RPC
  • Component Object Model (COM) Allows two-way interprocess communication of typed data between machines running any operating system that supports COM

All network communication mechanisms can be quite complex, each having its own nuances. In fact, whole books that discuss sockets, RPC, and COM are available. For this reason, I have decided not to address communication mechanisms directly in this book and instead encourage you to seek out other sources for information about them. Of all the mechanisms I mentioned in the preceding list, named pipes are the easiest to understand and use, and so most of the sample applications in this book that require network communication use named pipes.

NOTE
You can also use native network protocols (IPX/SPX/NetBIOS, NetBEUI, TCP/IP, AppleTalk, and so on) as your communication mechanism. However, Microsoft strongly discourages this because it ties your application to a specific protocol, whereas the other higher level mechanisms (mailslots, pipes, sockets, RPC, and COM) work over all the native protocols, allowing your application to run in more varied environments.



Programming Server-Side Applications for Microsoft Windows 2000
Programming Server-Side Applications for Microsoft Windows 2000 (Microsoft Programming)
ISBN: 0735607532
EAN: 2147483647
Year: 2000
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net