PDA

Click to See Complete Forum and Search --> : applet for mud connection


jdavison
Aug 22nd, 2000, 02:19 PM
I was wondering if anybody could help me get started in creating an applet to connect to a mud. Should be similiar to chat. If anybody can help reply or email me at jdavison2000@yahoo.com.

parksie
Aug 22nd, 2000, 02:37 PM
Take a look at the Socket class, and hook it into a BufferedReader.

jdavison
Aug 22nd, 2000, 03:10 PM
I tried that but the socket won't connect to anything. here is the code:

String address;

Socket socket=null;
InputStreamReader isr=null;
BufferedReader in=null;
PrintWriter out=null;
address= "ros.wolfpaw.net";
//attempting to connect to server
try{
socket=new Socket(address, portnum);

isr=new InputStreamReader(socket.getInputStream());
in=new BufferedReader(isr);
out=new PrintWriter(socket.getOutputStream(),true);
}
catch(IOException e){
System.err.println("Error: Could not create stream socket " + e.getMessage());
System.exit(1);
}

parksie
Aug 22nd, 2000, 03:21 PM
Hang on, I'll search out a chat example and email it to you.

jdavison
Aug 22nd, 2000, 03:24 PM
Thanks, I appreciate it