blob: b71915780cccfda28ad1c977a6ac937d0dd62585 [file] [log] [blame]
/**********************************************************************
* Copyright (c) 2003, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
 *
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
package org.eclipse.wst.internet.monitor.core.internal;
import java.io.IOException;
import java.net.Socket;
import org.eclipse.wst.internet.monitor.core.IMonitor;
import org.eclipse.wst.internet.monitor.core.MonitorCore;
import org.eclipse.wst.internet.monitor.core.ProtocolAdapterDelegate;
/**
*
*/
public class TCPIPProtocolAdapter extends ProtocolAdapterDelegate {
public void connect(IMonitor monitor, Socket in, Socket out) throws IOException {
Request request = new Request(MonitorCore.findProtocolAdapter("TCPIP"), monitor.getLocalPort(), monitor.getRemoteHost(), monitor.getRemotePort());
Connection conn = new Connection(in, out);
DefaultThread requestThread = new DefaultThread(conn, request, in.getInputStream(), out.getOutputStream(), true);
requestThread.start();
new DefaultThread(conn, request, out.getInputStream(), in.getOutputStream(), false).start();
}
}