FileDocCategorySizeDatePackage
AsyncReadSocket.javaAPI DocExample2238Thu Feb 04 16:10:36 GMT 1999None

AsyncReadSocket

public class AsyncReadSocket extends Thread

Fields Summary
private Socket
s
private StringBuffer
result
Constructors Summary
public AsyncReadSocket(Socket s)

		this.s = s;
		result = new StringBuffer();
	
Methods Summary
public synchronized voidappendResult(char c)

		result.append(c);
	
public synchronized java.lang.StringgetResult()

		String retval = result.toString();
		result = new StringBuffer();
		return retval;
	
public voidrun()

		DataInputStream is = null;
		try {
			is = new DataInputStream(s.getInputStream());
		} catch (Exception e) {}
		while (true) {
			try {
				char c = is.readChar();
				appendResult(c);
			} catch (Exception e) {}
		}