RMI and Threading

K

KDawg44

Hi,

I have a task for a class i am in to write an instant messaging java
app that communicates with a server using RMI. The client has to have
two threads running, one to send out messages (communicate with server
to get information about the other client to send to and then open a
socket to that client's address) and another to listen for messages (a
serversocket accepting incoming messages from other clients).

I have used threads before but usually to allow concurrent connections
on a server and for some reason this is really messing me up.

Any advice on how to get my mind around this would be appreciated....

I know this is kind of vague but I am not exactly sure what else to
put down...

Thanks for any direction....
 
L

Lionel van den Berg

KDawg44 said:
I know this is kind of vague but I am not exactly sure what else to
put down...

You're right, it is vague. We don't even know what is messing you up.
Please elaborate on what you do not understand!
 
D

Daniel Pitts

KDawg44 said:
Hi,

I have a task for a class i am in to write an instant messaging java
app that communicates with a server using RMI. The client has to have
two threads running, one to send out messages (communicate with server
to get information about the other client to send to and then open a
socket to that client's address) and another to listen for messages (a
serversocket accepting incoming messages from other clients).

I have used threads before but usually to allow concurrent connections
on a server and for some reason this is really messing me up.

Any advice on how to get my mind around this would be appreciated....

I know this is kind of vague but I am not exactly sure what else to
put down...

Thanks for any direction....
Generally, the RMI framework handles the threading and connections for
you. On the other hand, RMI is particular poorly suited to any
situation where one or both sides are behind a firewall. You'd be better
off finding an alternate means of communication. Either by designed a
custom protocol yourself, suited specifically to your Instant Messaging
domain, or by using one of the many technologies designed for this use.
Also note that there are some libraries that handle I.M. with all the
major networks for you. Libpurple comes to mind, but its not Java
based, so you'd have to either find a Java version, write a JNI wrapper,
or create your app in another language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top