1 /**********************************************************************
2 * Copyright (c) 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM - Initial API and implementation
10 **********************************************************************/
11 package net.sourceforge.phpdt.monitor.core.internal;
13 import java.io.IOException;
14 import java.net.Socket;
16 import net.sourceforge.phpdt.monitor.core.IMonitor;
17 import net.sourceforge.phpdt.monitor.core.IProtocolAdapterDelegate;
18 import net.sourceforge.phpdt.monitor.core.MonitorCore;
22 public class TCPIPProtocolAdapter implements IProtocolAdapterDelegate {
23 public void parse(IMonitor monitor, Socket in, Socket out) throws IOException {
24 Request request = new Request(MonitorCore.getProtocolAdapter("TCPIP"), monitor.getLocalPort(), monitor.getRemoteHost(), monitor.getRemotePort());
25 Connection conn = new Connection(in, out);
26 DefaultThread requestThread = new DefaultThread(conn, request, in.getInputStream(), out.getOutputStream(), true);
27 requestThread.start();
28 new DefaultThread(conn, request, out.getInputStream(), in.getOutputStream(), false).start();