• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Socket communiction works on XP but not on Vista

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Situation summary:
Running two java applications on the same machine.
App A is launched and creates a ServerSocket on port 4445.
App B is launched after App A. It creates a ServerSocket on port 4446 and then sends a message to port 4445 (send config).
App A receives message on port 4445 and sends message (config) to port 4446.
App B receives message on port 4446.

This worked fine on all flavors of XP (and I believe it was tested on Windows NT, 2000 and 2003, too).
When tried on Vista, both Apps are unable to send messages; java.net.ConnectException: Connection refused: connect.
Neither app has a problem with serversocket creation or accept() (at least no error is reported).

I turned off the firewall with no change.

I am new to Vista and need some guidance as to what to try next.

Abbreviated details:
App B


App A code is the same except for portNum.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Java Ranch
I just whipped up a simple test app on Vista that just bound to a port and another app which connected to that port. I got a firewall popup that indicated that my "server" was blocked and it allowed me to make an exception. After adding the exception, the program worked just like on XP.
Can you give us an small sample app (or two, in this case) which exhibits this behavior?
[ August 21, 2008: Message edited by: Joe Ess ]
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could use the TCPView app from sysinternals to determine if the ports are opened (and who has them open).

Also, I have found that turning off the firewall is sometimes not that helpful. I have had to uninstall the firewall and reboot to get certain things to run (this was on XP and Vista).
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a similar problem except I'm connecting to an external server. My program simply does:

Socket socket = new Socket (host, port);

and it works for a few hundred customers except for two who both happen to have Vista Home Premium. We have other customers for whom it does work on Vista Home Premium.

On the computers where it does not work, I have had them use the TELNET program to see if there is a problem with some security program blocking the host or port. However, I am able to connect via TELNET to the same host and port but the Java program tries to connect and a couple of minutes later returns with an Exception. I know that the TELNET connection works because I watch the server and it does receive what I ask them to type.

Does Vista have some kind of a security issue where it may be blocking access to ports on certain programs?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

it may be blocking access to ports on certain programs?



If I get this correctly, your customer runs a Java app that connects to your server. If that is the case, the answer to your question is "Yes." Most firewall apps that block outbound requests do it based on the full path name of the application's .exe file that is making the outbound request.

One of the things I have noticed in firewall configuration is that many firewalls offer "automatic" or "manual" configuration modes. In "manual" mode, it asks you about every outbound connection and if you want to accept it. In "automatic" configuration mode, it guesses. In many cases it guesses wrong so I always set up my firewall to use "manual" mode.

But even in manual mode, here is what could happen. The user runs some Java app, a pop appears asking for network access, and the user clicks on "no". The app runs just fine. Later the user runs your Java app and finds she cannot connect. The reason is that the exact same java.exe file is being used for both Java apps - the firewall cannot distinguish between Java apps.

One thing you can try is have them verify that their firewall is in "manual" config mode, then install a new JDK, and run the app with the java.exe from that JDK. The firewall should then ask for permission again. Alternately, they could clean up the program configuration in the firewall - most firewalls will tell you how each .exe file is configured (allow vs. disallow), and you can often remove entries from this table.
 
Sam Lalani
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, thank you for the response.

A correction: The first customer to have the problem has Vista Basic, and the second customer has Vista Home Premium.

The first customer has an E-machine, and to attempt to fix the problem, we reinstalled his OS, did NOT install his anti-virus, and turned off the firewall. The problem still existed where TELNET connected to the server but the Java program did not. So we thought it may be his router, so we connected our laptop to his router and the Java program ran fine on the laptop.

This is a very strange problem. And now that there is a second customer with a similar issue, we're thinking there's something we're missing that is in the Vista OS that's pre-packaged with these computers.

Any thoughts on this problem will be appreciated.

Thanks.
 
Allan Sorenson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It turns out that the problem was HOW App B was being launched. App B was launched by App A via an InstallAnywhere LaunchAnywhere created with IA 5.5. Generally, it looks like an IA 5.5 LaunchAnywhere and Vista do not play nice.

Thanks for your ideas and suggestions!
 
This tiny ad is suggesting that maybe she should go play in traffic.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic