18045010223
7 天以前 afe371d39a054b2f2a9e5875b945584eec8a8141
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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();
    }
}