?
Solved

VB6 windows service not able to listen to local TCP port on Server 2008

Posted on 2011-04-27
7
Medium Priority
?
703 Views
Last Modified: 2012-05-11
I have a legacy VB6 application that can run as a service or as a desktop application.  It opens a local TCP port and listnens for a connection from a remote client.  We recently migrated our server to Windows Server 2008.  We also put all the firewall rules in Windows Firewall (both allowing the application on any port and all connection to the local port desired) that we had in Windows Server 2003.  

The application, when running as a desktop app, opens the local TCP port and works perfectly.  However, when we try to run it as a service, it fails to open the local TCP port (the remote client fails to connect and we can't see the port as LISTENING when we run a NETSTAT).  We've tried setting the Service to run as various accounts (a domain account, a local account, and Local System), but still can't get it open the port.

What else do I need to do in order to get it to listen on the port?
0
Comment
Question by:Uniqueinc
  • 3
  • 2
  • 2
7 Comments
 
LVL 7

Accepted Solution

by:
OklahomaDave earned 2000 total points
ID: 35480177
Although its been a while since I ran a VB6 app as a service, I do seem to recall a subtlety that can sometimes cause the app, when running as a service, to start in an unexpected way that prevents the "core" application from running. That is, your app may, indeed, be starting, but the part that actually does the IP listening isn't really firing.

If you still have the source, you might take the time to add some basic file-based logging to ensure the parts of the app you think are firing really are, in fact, firing.
0
 
LVL 7

Expert Comment

by:OklahomaDave
ID: 35480185
P.S. I would also make sure that any dependent libraries required by the application/service can be accessed from its host location. You might also run a copy of ProcessMonitor as you start the service to see if there are any file access failures, eg file not found or access denied.

0
 
LVL 11

Expert Comment

by:kbirecki
ID: 35480443
Plus check that al files and folders needed by the app are accessible to the account you use for the service.  As a test, you could eliminate possible firewall problems by temporarily turning it off and see if that makes a difference.  Also try the domain administrator as the service acct to see if that identifies permission problems.

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Uniqueinc
ID: 35480466
OklahomaDave, Godd idea. I'll have to get with my company's dev team to see if they can add file logging.  I'm not sure how long it will take them to get it added though.

kbirecki, thanks for the ideas.  Unfortunately we've already tried them.  I've run the service as a domain and local admin as well as having all firewall (Windows and McAfee) disabled.  

Anything other thoughts?
0
 
LVL 11

Expert Comment

by:kbirecki
ID: 35480493
Have you tried running the app as a service on something other than Server 2008?  Maybe win xp or win 7?  Win 7 would be closest to server 2008, but win xp would be easier to test the app functioning as a service - fewer security restrictions to deal with.
0
 
LVL 11

Expert Comment

by:kbirecki
ID: 35480514
You could also run something like Nirsoft's OpenFileView to see that it is running as expected.  Running and responding though are two  different things.  Otherwise, oklahonadave's suggestions  seem like the next best step to see if the ports are actually being opened.
0
 

Author Closing Comment

by:Uniqueinc
ID: 35505215
They didn't give me the solution, but they provided the means for me to find the solution.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
OfficeMate Freezes on login or does not load after login credentials are input.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question