Re: java socket programming doubt
- From: GArlington <garlington@xxxxxxxxxxxxx>
- Date: Tue, 20 May 2008 03:11:34 -0700 (PDT)
On May 19, 2:42 pm, sam.bark...@xxxxxxxxx wrote:
Hi All,
I am trying to create a udp socket.
It works fine but the program hhangs for a few seconds[at
DatagramSocket clientSocket = new DatagramSocket();] before ti
actually sends the data out.Could any one tell me why?
try
{
System.out.println("Creating datagram");
DatagramSocket clientSocket = new DatagramSocket();
InetAddress IPAddress =
InetAddress.getByName("localhost");
byte[] sendData;
byte[] receiveData = new byte[1024];
String sentence ="TEST";
sendData = sentence.getBytes();
DatagramPacket sendPacket =
new DatagramPacket(sendData, sendData.length,
IPAddress, 9876);
clientSocket.send(sendPacket);
}
Cheers,
Sam
It doe NOT [your code copied into main] for me. So check the rest of
your code...
BTW: why do you think that it hangs there? (and NOT somewhere else)?
.
- References:
- java socket programming doubt
- From: sam . barker0
- java socket programming doubt
- Prev by Date: about conversion of MS word to MS excel
- Next by Date: Re: about conversion of MS word to MS excel
- Previous by thread: java socket programming doubt
- Next by thread: Why jsp can't get the Vector fill with user-defined class by the Remote interface?
- Index(es):