Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


June 1997

Develop a Windows NT Internet Service


RSS
Subscribe to Windows IT Pro | See More Internet Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

Learn how an Internet protocol, such as Finger, can run as a Windows NT service

Millions of users access the Internet through systems running Windows or Windows NT. When you use NT to access Internet services such as Finger, Gopher, or Archie, you ordinarily start them individually at the command line (i.e., outside NT). Instead of starting these programs individually, try running them as NT services so that you can access them from within NT whenever you want.

In this article, I explain Finger (an Internet service that lets you query for information about Internet users or sites) and an NT Finger service I developed. In a longer version of this article, available on the Web at http://www.winntmag.com, I explain in detail how the NT Finger service works and provide the code for it.

What Is Finger?
Finger is a daemon that lets Internet users (Finger clients) query a Finger server for information about other Internet users or sites and returns responses to queries. With Finger, you can find out a user's (account owner's) full name, the last time that user logged on, and which users are currently logged on. A Finger operation can also return a plan, or finger, file--a text file that contains detailed information about an account owner, such as the user's degree, office hours (for a professor), resumés, or even Pretty Good Privacy (PGP) keys for digital signatures.

How to Finger an Account
Many operating systems, including NT, provide a small application that lets you Finger for remote users from the operating system's prompt. To use Finger with NT, from the command prompt, you simply enter

finger accountname

to resolve a remote address and query the remote host for the specified user.

Screen 1 shows an example of using Finger with a remote UNIX host. In Screen 1, I first accessed a remote UNIX host via Telnet. Then at the prompt, I entered finger

etoupin@csn.net

to query a Finger daemon in the csn.net domain (Colorado Supernet Internet Service Provider--ISP) for user etoupin. The Finger client waits until it receives a response or a timeout occurs, and displays the returned information as shown.

The NT Finger Service: How It Works
The NT Finger service is a standard, event-driven service that resides in the Service Control Manager (SCM) database. You control this service through the SCM. This service monitors the Finger TCP port (79) for requests and is transparent to the user of the system on which it resides.

A Finger service must have access to a database of users and user information. From this database, the Finger service formats and submits information to remote requesting client systems. The NT Finger service obtains this information from the Security Accounts Manager (SAM) database.

The Finger service provides a simple executable module that the SCM manages. At NT startup time, when SCM starts the Finger service, the service creates a socket and then awaits incoming connect requests from remote clients.

The NT Finger Service: Take It from Here
Finger is an easy protocol to implement as a service. You can take the service code, enhance it, extend the protocol's functionality, or even create a new service to support another Internet protocol.

Note that many other Internet protocols--such as Simple Mail Transfer Protocol (SMTP), Post Office Protocol (POP), HTTP, and FTP--are more complex than Finger. Thus, NT services for these protocols require you to write additional code, such as worker threads, or use the Visual C++ (VC++) C Thread class to handle simultaneous requests and concurrent operations as the protocol requires. The online Finger service code is a basic template that you can use for many other Internet protocol services.

For a more detailed explanation and complete code, visit http://www.winntmag.com.

End of Article



Reader Comments

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement