Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Use Threads with UDP server

807569Jun 21 2006 — edited Jun 22 2006
Hi,
I want to use thread in an UDP server;

With a TCP protocol I use Thread simply creating a class that extends Thread with a constructor having a Socket type argument, and a run() method, and then creating an istance of this class and using the start() method.

But, with the UDP server I've a DatagramSocket and a DatagramPacket;
so must I pass both DatagramSocket and a DatagramPacket to my Thread extending class constructor?

Is there a common standard way to operate?

Thank you and excuse me for english.

MargNat

Message was edited by:
MargNat
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2006
Added on Jun 21 2006
12 comments
730 views