EMMA Coverage Report (generated Tue Dec 18 20:38:46 CET 2007)
[all classes][cz.vutbr.feec.session.feedback]

## COVERAGE SUMMARY FOR SOURCE FILE [ThreadOut.java]

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
ThreadOut.java | 0% (0/1) | 0% (0/6) | 0% (0/93) | 0% (0/31)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class ThreadOut | 0% (0/1) | 0% (0/6) | 0% (0/93) | 0% (0/31)
<static initializer> |  | 0% (0/1) | 0% (0/5) | 0% (0/3)
ThreadOut (InetAddress, int, int): void |  | 0% (0/1) | 0% (0/26) | 0% (0/6)
getSession (): FeedbackSessionStatus |  | 0% (0/1) | 0% (0/3) | 0% (0/1)
run (): void |  | 0% (0/1) | 0% (0/46) | 0% (0/16)
setFeedback (InetAddress, int): void |  | 0% (0/1) | 0% (0/9) | 0% (0/3)
setSession (FeedbackSessionStatus): void |  | 0% (0/1) | 0% (0/4) | 0% (0/2)

1 | package cz.vutbr.feec.session.feedback;
2 |
3 | import java.io.IOException;
4 | import java.net.DatagramPacket;
5 | import java.net.DatagramSocket;
6 | import java.net.InetAddress;
7 | import java.net.SocketException;
8 |
9 | import org.apache.log4j.Logger;
10 |
11 | import cz.vutbr.feec.packets.rsi.RSIPacket;
12 | import cz.vutbr.feec.session.SessionThreadOut;
13 |
14 | /**
15 | * Vysila pres unicast zpetnou vazbu nadrazenemu feedback targetu.
16 | * @author Radim Burget
17 | */
18 | public class ThreadOut extends SessionThreadOut {
19 |
20 | private static Logger logger = Logger.getLogger(ThreadOut.class
21 | .getName());
22 | private FeedbackSessionStatus session;
23 |
24 | private DatagramSocket socket;
25 |
26 | private DatagramPacket packet;
27 |
28 | private byte[] buffer;
29 |
30 | public ThreadOut(InetAddress address, int port, int rsiTime) throws SocketException {
31 | super(rsiTime);
32 | setName("TTP-FT(out unicast)");
33 | socket = new DatagramSocket();
34 | buffer = new byte[1500];
35 | packet = new DatagramPacket(buffer, 4, address, port);
36 | }
37 |
38 | @Override
39 | public void run() {
40 | logger.debug("STARTED");
41 | while(!isStopped()) {
42 | try {
43 | sleep(reportingPeridod);
44 | // Sending the RSI packet
45 | RSIPacket pkt = new RSIPacket();
46 | pkt.setSSRC(1<<31);
47 | pkt.setSSRCSummarized(1<<31);
48 |
49 | socket.send(packet);
50 | logger.debug("RSI sent");
51 | } catch (InterruptedException e) {
52 | if(isStopped()) break;
53 | } catch (IOException e) {
54 | e.printStackTrace();
55 | System.exit(-1);
56 | }
57 | // process packet
58 | }
59 | socket.close();
60 | logger.debug("FINISHED");
61 | }
62 |
63 | protected void setSession(FeedbackSessionStatus session) {
64 | this.session = session;
65 | }
66 |
67 | protected FeedbackSessionStatus getSession() {
68 | return session;
69 | }
70 |
71 | public void setFeedback(InetAddress address, int port) {
72 | packet.setAddress(address);
73 | packet.setPort(port);
74 | }
75 | }

[all classes][cz.vutbr.feec.session.feedback]
EMMA 2.0.5312 EclEmma Fix 1 (C) Vladimir Roubtsov