Hey there, I've got a small problem. I'm writing an UDP client-server system, and I wanted to use streams with UDP. I found UDPOutputStream source and pasted it into my project. Now, when I try to initialize it, it freezes. This is how I try to initialize it:

outStream = new UDPOutputStream(InetAddress.getByName(serverAddress), port);
System.out.println("UDP streams initialized."); // Doesn't get called at all

I opened the source and found out it's this line that freezes (inside the UDPOutputStream.java):

dsock = new DatagramSocket();

Why does this happen? I use the same line of code in my server program, and it works just fine. Am I missing something here or is it a bug or...?

Recommended Answers

All 2 Replies

Are you catching any exceptions and printing the stack trace?

Sorry, forgot to mention: No exceptions thrown whatsoever.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.