H
huwind
I am writing a client/server based instant messenger in java and have
the problem to monitor the incoming massages via socket on the client
side.
I have some GUI widnows for login, select a contact to talk, and the
chat window. What I wanna implement is that after the user login, a
monitoring thread will be created and it listens to the port. Once
there is a message coming in, it calls methdds to process the message
acccroding to the messge types.
The problems I have now are:
1. I have a worker thread, say myListener, to listen to the port. The
listening work in done by an infinite loop which reads the content of
the input stream of the socket. But when I call myListener.start(), it
seems that the thread myListener isn't executed. How can I monitor the
socket on the client side?
2. How can I get the active window?
Any help will be appreciated.
the problem to monitor the incoming massages via socket on the client
side.
I have some GUI widnows for login, select a contact to talk, and the
chat window. What I wanna implement is that after the user login, a
monitoring thread will be created and it listens to the port. Once
there is a message coming in, it calls methdds to process the message
acccroding to the messge types.
The problems I have now are:
1. I have a worker thread, say myListener, to listen to the port. The
listening work in done by an infinite loop which reads the content of
the input stream of the socket. But when I call myListener.start(), it
seems that the thread myListener isn't executed. How can I monitor the
socket on the client side?
2. How can I get the active window?
Any help will be appreciated.