Java HTTP Port Find sendCommand(String host, Integer port, String cmd)

Here you can find the source of sendCommand(String host, Integer port, String cmd)

Description

send Command

License

Apache License

Declaration

public static void sendCommand(String host, Integer port, String cmd) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.OutputStream;
import java.net.Socket;

public class Main {
    public static void sendCommand(String host, Integer port, String cmd) throws Exception {
        Socket socket = new Socket(host, port);
        OutputStream out = socket.getOutputStream();
        out.write(cmd.getBytes());//from  w w  w.  j  av  a  2 s  .  co  m
        out.close();
        socket.close();
    }
}

Related

  1. resolve(final String desc, final int defaultPort)
  2. safePort(final String port)
  3. searchPort(int number, int even, boolean stream)
  4. selectAvailablePort(int preferedPort)
  5. sendCommand(final String command, final int monitorPort)
  6. serverIsUp(int port)
  7. ServerListening(String host, int port)
  8. serverListening(String host, int port)
  9. serverListening(String hostName, int port)