• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.net.BindException: Address already in use: Cannot bind  RSS feed

 
Shiham Nawaz
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i'm trying to make a voice call using UDP. On the click of button, the client should capture the voice from the mic, put it into datagramPackets and send them to a particular server(one port number) where it plays the voice.
I tried this and it kept on throwing the following exception :
java.net.BindException: Address already in use: Cannot bind

Pls help me as to how i can overcome this.
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it means that you are trying to use a port that is already open.
to test this you can follow these steps :

before running your application open a command console ,
execute : netstat -n | find "your port number here"

check to see whether the port that you want to open is already open or not.

also it may cause that your fireWall do not allows the application to listen on the port.

let me know whether you overcome this or not.
 
Shiham Nawaz
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thank you for the solution.

I've overcome the problem now. Infact, i was using the same port twice.

But now i've got a problem of sending voice packets over UDP. I think my buffer is getting full and i do not know how to flush it and also i've not found a way to limit the packet size to a certain amount.
Can you pls help me in this regard.

Thank you
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!