狠狠撸

狠狠撸Share a Scribd company logo
//package akiyo;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author rudi
*/
import java.io.*;
import java.net.*;
class Akiyo {
public static void main(String args[]) throws Exception
{// while(true){
int [] dataVideo = {15876,1223,1116,937,1163,1168,1079,1234,1289,1388,1230,1383,
1727,2016,2387,3010,3525,3753,3945,3897,3644,3300,2789,2589,2652,2404,2478,2
833,
3189,3298,3508,3337,2856,2745,2892,3148,3043,3154,3181,3050,15781,2408,2372,
2181,
2340,2411,2561,2866,2546,2158,1462,1326,1633,1934,2134,2199,2120,1713,2410,2
534,
2645,2724,2574,2482,2386,2230,2700,2717,2962,3254,3490,3707,3582,3338,2349,2
362,
2773,3116,3355,3417,15683,2516,2399,2387,2661,3169,3289,3123,2941,2971,2842,
2882,
2892,2826,2890,3111,2956,2615,1948,2047,1940,2163,2015,2283,3064,3270,3119,2
794,
3032,3013,2644,2682,2664,2500,2563,2317,2004,1865,1472,1328,15681,1653,2014,
1871,1717,
1873,1845,1748,1840,2226,2167,2351,2272,2110,2406,3219,3502,3350,3124,2809,2
951,2647,
2262,2080,2150,2159,2035,2092,1948,2006,2110,2242,2479,2548,2659,2677,2880,2
915,2660,2730,
15823,2201,2632,2681,2482,
2007,1769,1810,1907,1700,1697,1585,1562,1350,1236,1388,1689,1881,
2144,2206,2024,1875,1951,1790,1614,1589,1664,2023,2001,1800,2085,1554,1365,1
295,1434,1646,1470,
1645,1968,2044,15761,1759,1961,1877,1794,1826,1942,2398,2685,2619,2545,2667,
2691,2846,2889,3043,
3042,3033,3055,2997,2961,2786,2787,2704,2672,2593,2549,2216,2366,2129,1875,2
126,2222,2164,2441,
2799,2899,2801,2842,2527,16193,2619,2919,2661,2493,2734,2524,2573,2628,2774,
2707,2443,2640,2721,
2525,2258,1741,1922,2552,2990,2890,2863,2754,2570,2004,1598,1840,2097,2167,1
980,1966,1967,2013,1951,
2109,2401,2646,3181,3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AAAAAAAAAAA
AAA"
+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAA";
int seq=0;
try {
String serverHostname = new String ("169.254.45.69");
if (args.length > 0)
serverHostname = args[0];
DatagramSocket clientSocket = new DatagramSocket();
InetAddress IPAddress = InetAddress.getByName(serverHostname);
System.out.println ("Attemping to connect to " + IPAddress + ") via UDP port
9876");
byte[] sendData = new byte[1024];
byte[] receiveData = new byte[1024];
int jumlahPerulahan=5;
for(int j=0;j<jumlahPerulahan;j++){
for (int i=0; i<dataVideo.length;i++){
int packetNumber=(int)Math.ceil((double)dataVideo[i]/1024);
for(int x=0;x<packetNumber;x++){
System.out.println("Sending packet: "+seq+" Frame: "+i);
double time =System.currentTimeMillis();
String str="Seq: "+seq+" Frame: "+i+" SendTime: "+time+" "+s;
sendData = str.getBytes();
DatagramPacket sendPacket =
new DatagramPacket(sendData, sendData.length, IPAddress, 9876);
clientSocket.send(sendPacket);
seq++;
}
Thread.sleep(40);
}
}
clientSocket.close();
}
catch (UnknownHostException ex) {
System.err.println(ex);
}
catch (IOException ex) {
System.err.println(ex);
}
}
}

More Related Content

Package akiyo