Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Any UDP port in the Internet
- From: t_lepski@xxxxxxxxxxx (Tom Lepski)
- Subject: Any UDP port in the Internet
- Date: Sun, 29 Oct 2000 14:49:27 GMT
>
>du anybody know about any UDP port which waits in the internet so that I
>can
>test my program ..
>
Although I don't know of any such server but you can write a small program
and run it on your own mc/ that should do the job for you...
public class UDPServer
{
private byte[] buf = new byte[10000];
private DatagramPacket packet =
new DatagramPacket(buf, buf.length);
private DatagramSocket socket;
public UDPServer()
{
try
{
socket = new DatagramSocket(3333);
while(true)
{
socket.receive(packet);
// print out the packet info
System.out.println("Received "+packet);
}
}
catch(SocketException e)
{
e.printStackTrace();
}
}
public static void main(String[] args)
{
new UDPServer();
}
}
-Tom.
Get Certified, Guaranteed!
(Now revised for the new pattern)
http://www.enthuware.com/jqplus
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx
- Prev by Date: loading classes
- Next by Date: Deployment Problem
- Previous by thread: loading classes
- Next by thread: Deployment Problem
- Index(es):