multicasting in java
i wrote a program that communicates with the same program running on another computer. it's like an instant messenger program. problem is that is seems to only work when both programs are being run on the same network. I need to run it off of my schools unix machine and simultaneously run it from my home windows PC (different networks). i send datapackets through datasockets, while concurrently checking the multicastsocket.
this is what i use to read the multicastsocket:
byte buf = new byte;
packet = new DatagramPacket(buf, buf.length);
String answer = new String(packet.getData(), 0, packet.getLength());
and this is my sending data procedure:
String mes = inputField.getText();
DatagramSocket socket = new DatagramSocket();
DatagramPacket packet2 = new DatagramPacket(mes.getBytes(), mes.length(), group, port.intValue());
this is how i connect:
String host = (String)ipBox.getSelectedItem();
port = new Integer(portText.getText());
msocket = new MulticastSocket(port.intValue());
group = InetAddress.getByName(host);
if anyone could help i'd really appreciate it. i've been working on this (as well as different methods of connecting) for 5 hours today.