I've got a problem with a java.net.DatagramSocket. It seems impossible
to create multiple socket with the same address (any) and port. I don't
know why it tries to Bind the socket, since it is for writing only (and
it's compulsory in that use). I need to have at least two sockets on
that port (one in Java, the other for the server). I succesfully create
n socket in C++ in the same app, but not in Java
java.net.BindException: Address already in use
at java.net.PlainDatagramSocketImpl.bind(Native Method)
at java.net.DatagramSocket.create(DatagramSocket.java:164)
at java.net.DatagramSocket.<init>(DatagramSocket.java:140)
at java.net.DatagramSocket.<init>(DatagramSocket.java:112)
at com.chris.IHM.IHM_demo.main(IHM_demo.java:50)
When I run the app on another PC it's OK.
How can I achieve this ?
Cyril ZEKSER
VISIOSPACE
> You can use the same socket for sending and receiving, so your software
> logic needs to understand that.
Thanks, I know that, but It wasn't the sense of my question.
What I want to do is to have the Java prog, and the C++ server, both using
the same port and address (local or Any). In c++ I can run many instances,
but not in JAVA. When the C++ server runs, Java hangs.
Cyril