Demos and Usage of java.net.Socket.setTcpNoDelay(boolean on)


   1:         try {
   2:         Socket newSock = s.accept();
   3:         ...
   4:         newSock.setTcpNoDelay(true);
   5:         System.out.println("CricketDaemon accepting new connection from "+
   6:                    newSock.getRemoteSocketAddress());
   7:         scl.registerClient(newSock); 

View Full Code Here
   1: import java.io.IOException;
   2: import java.net.Socket;
   3: 
   4:         ...
   5:     public
   6:     Runnable accept(Server server, Socket socket) throws IOException
   7:     {
   8:         ...
   9:         socket.setTcpNoDelay(on);
  10:         return base.accept(server, socket);

View Full Code Here
   1: import java.net.ServerSocket;
   2: import java.net.Socket;
   3: import java.util.ArrayList;
   4:         ...
   5:                 
   6:                 Socket client = msgServer.accept();                
   7:                 
   8:                 if(Report.should_report("cluster", Debug.comm))
   9:                     Report.report(Debug.comm, "Accepted a connection from: "+client.getInetAddress());

View Full Code Here
   1: 
   2:       Socket echoSocket = null;
   3:       PrintWriter out = null;
   4:         ...
   5:       try {
   6:          echoSocket = new Socket(proxyHost, port);
   7:         ...
   8:          echoSocket.setTcpNoDelay(true);
   9:          echoSocket.setSoLinger(true, 2000);

View Full Code Here
   1: import java.net.ServerSocket;
   2: import java.net.Socket;
   3: import java.nio.channels.Selector;
   4:         ...
   5: 
   6:     Socket socket = _ss.accept();
   7: 
   8:         ...
   9:     if (_tcpNoDelay)
  10:       socket.setTcpNoDelay(true);

View Full Code Here
   1:         InetSocketAddress address = new InetSocketAddress(port);
   2:         ssc.socket().bind(address);
   3: 
   4:         ...
   5:             listenKey.cancel();
   6:             ssc.socket().close();
   7:             ssc.close();
   8:         ...
   9: 
  10:             System.out.println(ssc.socket().isClosed());
  11:         }
  12:         ...
  13:     {
  14:         s.setTcpNoDelay(true);

View Full Code Here
   1: 
   2: import java.net.Socket;
   3: import java.net.SocketException;
   4:         ...
   5: 
   6: public class SSHVersionSpySocket extends Socket {
   7:     PushbackInputStream pbIn;
   8:         ...
   9:     Socket              origSocket;
  10: 
  11:         ...
  12:     public void setTcpNoDelay(boolean on) throws SocketException {
  13:     origSocket.setTcpNoDelay(on);

View Full Code Here
   1: 
   2: import java.net.Socket;
   3: import java.util.Hashtable;
   4:         ...
   5:             try {
   6:                 Socket sock = new Socket(end.host, end.port);
   7:                 ret =  new Streams(sock,
   8:                         new LoggingObjectOutputStream(sock.getOutputStream()),
   9:                         new LoggingObjectInputStream(sock.getInputStream()));

View Full Code Here
   1: 
   2:     private Socket socket;
   3:     private ObjectOutputStream netOut;
   4:         ...
   5:         System.out.println("BeaconConfig NetworkClient::connecting...");
   6:         if(socket != null)
   7:         socket.close();
   8:         ...
   9:         
  10:         socket.setTcpNoDelay(true);

View Full Code Here
   1: class SocketConnection implements Runnable {
   2:     Socket socket;
   3:     DataOutputStream out;
   4:         ...
   5: 
   6:     SocketConnection(ProxyListener proxy, Socket socket)
   7:         throws IOException {
   8:         ...
   9:         this.socket = socket;
  10:         socket.setTcpNoDelay(true);
  11:         in = new DataInputStream(new BufferedInputStream(socket.getInputStream()));

View Full Code Here
   1:   private OutputStream out;
   2:   private Socket socket;
   3: 
   4:         ...
   5:       if(socket_factory==null){
   6:         socket=new Socket(proxy_host, proxy_port);    
   7:         in=socket.getInputStream();
   8:         ...
   9:       }
  10:       socket.setTcpNoDelay(true);

View Full Code Here
   1:     {
   2:     Socket s;
   3:     ObjectInputStream ois;
   4:         ...
   5: 
   6:     public ClientRecord(Socket s)
   7:         throws IOException
   8:         ...
   9: 
  10:         s.setTcpNoDelay(true);
  11:         is = s.getInputStream();

View Full Code Here
   1: import java.net.*;
   2: import java.net.Socket;
   3: import java.io.InputStream;
   4:         ...
   5: 
   6: public class SocketWrapper extends Socket
   7: {
   8:         ...
   9:   private String id;
  10:   private Socket filling;
  11:   
  12:         ...
  13:   {
  14:     filling.setTcpNoDelay(on);

View Full Code Here
   1:     
   2:     Socket socket;
   3:     
   4:         ...
   5:     
   6:     public PlayerAgent(Socket socket, int playerIndex) throws SocketException, IOException{
   7:         this.socket = socket;
   8:         ...
   9:         protocol = null;
  10:         socket.setTcpNoDelay(true);
  11:         os = socket.getOutputStream();

View Full Code Here
   1:       while(thread!=null){
   2:         Socket socket=ss.accept();
   3:         ...
   4:     socket.setTcpNoDelay(true);
   5:         ...
   6:         InputStream in=socket.getInputStream();
   7:         OutputStream out=socket.getOutputStream();

View Full Code Here