hi Hannah
first thing don't use Datagrams b'coz it is not reliable, insted use TCP connection. here is a small program, i think this will help(this is not compiled program)
//server part
ServerSocket srvS = new ServerSocket(port);
while(true)
{
Socket s = srvS.accept();
BufferedReader readerIn = new BufferedReader(
new InputStreamReader(
s.getInputStream()));
String str = readerIn.readLine();
s.close();
}
// client part
Socket s = new Socket(ip,port);
// this yu can make it simple too
PrintWriter writerOut =
new PrintWriter(
new BufferedWriter( new OutputStreamWriter(
s.getOutputStream())),true);
writerOut.println("hello");
s.close();
i hope this will help
-regards
prasanna
[This message has been edited by Prasanna KumarBP (edited July 25, 2001).]