I am trying to create a chat application in java using RMI.
To make communication active between client - client I am using Socket programming in RMI to get client information, but once ServerSocket tries to accept connection on specified port it throws BindException::Address already in use Jvm_bind exception.
I dont know how to resolve this port conflict.Please help in solving this problem.
My dear friend.
Actually there is no need to use two different port for same application.
In order to create chat application in RMi, just gather the reference of each client in an Vector or LinkedList or any other data structure you feel feasible.
Then loop your message through all the clients using the LinkList, which will broadcast the message to all the clients.
I am damn sure this would workout as I have implemented the same in my chat application.
All the best.
public interface ChatClient1 extends Remote
public void receive (String s,String username,String IPAdd) throws RemoteException;
public void popUp(boolean flag,String uname) throws RemoteException;