All I want to do at the moment is figuring out how to determine whether a
port is in use. Knowing java from different systems / programming languages
this should be pretty straightforward. The snippet:
should give me the answer right away. The problem though is that I have a
C++ application sitting on the port first. And still the snippet tells me
that this port would not be in use.
Intrigued by that I wrote another small example accepting a connection to
this Java program. Here the outcome:
1. start C++ application on port X --> success
2. start Java application on port X --> success
3. telnet to localhost port X --> java responds (and shuts down)
4. telnet to localhost port X --> C++ responds
Now I'm completely clueless. I mean the C++ application will not bind to the
port if Java is already on the port, so what is going on here.
Jesse Wilson wrote:
My PowerBook lets me bind to the same port twice using NIO. The
following code throws an IOException under Windows and Linux, but not
under Mac OS X:
It wouldn't be too big a deal but I want my application to fail if it
can't bind! One horrible problem that has come up in my tests is
this: 1. Bind to port X as server. 2. Connect to self on port X as
client. Now the client has fully connected but server has not
received anything! Another server process that has binded to the same
port is receiving the data instead.
Is this a bug in the Mac JVM?
Any information on this problem will be appreciated, thanks!
_______________________________________________ Do not post admin
requests to the list. They will be ignored. Java-dev mailing list
(email@hidden) Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden