package cn.org.hentai.jtt1078.test;
|
|
import java.io.FileInputStream;
|
import java.io.InputStream;
|
import java.io.OutputStream;
|
import java.net.Socket;
|
|
/**
|
* Created by matrixy on 2019/4/10.
|
*/
|
public class VideoPushTest
|
{
|
public static void main(String[] args) throws Exception
|
{
|
// TODO setup Socket conn = new Socket("223.244.87.184", 1078);
|
// Socket conn = new Socket("47.104.204.210", 1078);
|
// Socket conn = new Socket("111.40.46.199", 7003);
|
Socket conn = new Socket("localhost", 7003);
|
OutputStream os = conn.getOutputStream();
|
|
// InputStream fis = new FileInputStream("e:\\workspace\\enc_dec_audio\\streamax.bin");
|
// InputStream fis = new FileInputStream("e:\\test\\streaming.hex");
|
InputStream fis = VideoPushTest.class.getResourceAsStream("/tcpdump.bin");
|
int len = -1;
|
byte[] block = new byte[512];
|
while ((len = fis.read(block)) > -1)
|
{
|
os.write(block, 0, len);
|
os.flush();
|
Thread.sleep(20);
|
System.out.println("sending...");
|
}
|
os.close();
|
fis.close();
|
conn.close();
|
}
|
}
|