Java HTTP Port Find doSend(String command, String server, String port)

Here you can find the source of doSend(String command, String server, String port)

Description

do Send

License

Open Source License

Declaration

static void doSend(String command, String server, String port) throws IOException 

Method Source Code


//package com.java2s;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class Main {
    static void doSend(String command, String server, String port) throws IOException {
        Socket socket = new Socket(server, Integer.parseInt(port));
        OutputStream os = socket.getOutputStream();
        BufferedOutputStream out = new BufferedOutputStream(os);
        out.write(command.getBytes());/*ww  w  .  j av  a  2s  . co m*/
        out.write('\r');
        out.flush();
        socket.close();
    }
}

Related

  1. availablePort(int prefered)
  2. canConnect(String host, int port)
  3. canConnect(String host, int port)
  4. canConnectOn(String host, int port)
  5. createUnresolved(String host, int port)
  6. executeHttpCommand(String host, int port, String request, String charset)
  7. exportResource(Class fromClass, String resourceName, String exportPath)
  8. findAvailablePort()
  9. findAvailablePort()