1 4 package com.tc.net.core; 5 6 import com.tc.net.TCSocketAddress; 7 import com.tc.net.core.event.TCConnectionEventListener; 8 import com.tc.net.protocol.NetworkMessageSink; 9 import com.tc.util.TCTimeoutException; 10 11 import java.io.IOException ; 12 import java.net.Socket ; 13 14 19 public interface TCConnection extends NetworkMessageSink { 20 21 25 public long getConnectTime(); 26 27 31 public long getIdleTime(); 32 33 39 public void addListener(TCConnectionEventListener listener); 40 41 45 public void removeListener(TCConnectionEventListener listener); 46 47 50 public void asynchClose(); 51 52 57 public Socket detach() throws IOException ; 58 59 64 public boolean close(long timeout); 65 66 75 public void connect(TCSocketAddress addr, int timeout) throws IOException , TCTimeoutException; 76 77 85 public boolean asynchConnect(TCSocketAddress addr) throws IOException ; 86 87 92 public boolean isConnected(); 93 94 99 public boolean isClosed(); 100 101 106 public TCSocketAddress getLocalAddress(); 107 108 113 public TCSocketAddress getRemoteAddress(); 114 } | Popular Tags |