Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Socket Programming Java

Options
  • 03-05-2005 2:02pm
    #1
    Closed Accounts Posts: 375 ✭✭


    DatagramSocket Socket = new DatagramSocket(34396);
    byte[] buffer = Transmission.getBytes();
    InetAddress IP = InetAddress.getByName(Source);
    DatagramPacket Packet = new DatagramPacket(buffer, buffer.length, IP, 5060);
    Socket.send(Packet);

    I have the above code and I'm, having a little trouble for some reason I get the following error

    java.net.BindException: Address already in use
    at java.net.PlainDatagramSocketImpl.bind0(Native Method)
    at java.net.PlainDatagramSocketImpl.bind(PlainDatagramSocketImpl.java:82)
    at java.net.DatagramSocket.bind(DatagramSocket.java:368)
    at java.net.DatagramSocket.<init>(DatagramSocket.java:210)
    at java.net.DatagramSocket.<init>(DatagramSocket.java:261)
    at java.net.DatagramSocket.<init>(DatagramSocket.java:234)
    at SipProxy.UseMess.OK(UseMess.java:153)
    at SipProxy.UseMess.Register(UseMess.java:51)
    at SipProxy.NetworkListener.run(NetworkListener.java:52)
    at java.lang.Thread.run(Thread.java:595)

    even if I change the port number, it seems to be the DatagramSocket line that cause this, This works perfectly at home so I'm not sure if it's a network issue? any help would be greatly appreciated!

    Regards
    Michael


Advertisement