Ah I see. Thanks Norm.
Type: Posts; User: worwhite
Ah I see. Thanks Norm.
Hmm was reading the wait and notify methods as you suggested, here's a pertinent part that I got:
This method should only be called by a thread that is the owner of this object's monitor. A thread...
....
You are saying that BOTH the sending and receiving parts HAVE to be a java Thread regardless of which way you do it. What you are telling me is that I do not need to extend a the Thread class...
Can you explain why?
Yes Sean4u. Thanks for pointing that out - that's the same answer given in another forum. Hmm ok I take your point about not tying up the event dispatch Thread. I guess it's good programming practice...
That's what I was asking...I'm supposed to need more, but I didn't. In any case this first question has already been answered in another forum. Still need answers to questions 2 and 3 if anyone knows.
To clarify: When I say object - I just mean an object (i.e. instance of a class) that is not a java Thread (i.e. does not extend the Thread class). When I say Thread, I am not refer to a generic...
Ah from what I know there's a bit of a distinction between an instantiated object and a thread. Threads can run concurrently to each other, while objects can't - if you have two objects they run...
Hmm client object as in an instance of the class that is created. It's executing but it's not created as a Thread (does not extend Thread or implement Runnable).
In this case we need to separate...
Ah that's my first question - I didn't... and it still worked. Oh and my second question is whether you need a thread for BOTH send/receive. Can I use a thread for receive and just the client object...
My client needs to be able to send messages while waiting for responses/server messages. It's not a case of send -> receive -> send receive etc.. The server may choose to send a message at any time,...
Hi,
I am writing a simple multithreaded client-server application using sockets, and have a few questions:
1. For the client, is it really necessary to use a separate thread (i.e. of the java...