DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
wib_packet_receiver Namespace Reference

Functions

 cli (port)
 

Variables

 console = Console()
 
 CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
 
 show_default
 
 True
 
 standalone_mode
 

Function Documentation

◆ cli()

wib_packet_receiver.cli ( port)

Definition at line 15 of file wib_packet_receiver.py.

15def cli(port):
16 console.log(f"Preparing to receive WIB packets on port {port}.")
17 sock = socket.socket(socket.AF_INET, # Internet
18 socket.SOCK_DGRAM) # UDP
19 sock.bind(("0.0.0.0", port))
20
21 rcv_bytes = 0
22 rcv_pkts_tot = 0
23 rcv_pkts = 0
24 rcv_bytes = 0
25 start_time = time.time();
26 while True:
27 try:
28 data, addr = sock.recvfrom(8192)
29 rcv_bytes += len(data)
30 wf = fddetdataformats.WIBEthFrame(data)
31 rcv_pkts +=1
32 if rcv_pkts_tot % 100000 == 0:
33 stop_time = time.time()
34 interval = stop_time - start_time
35 console.log(f"Received {rcv_pkts} packets: throughput is {rcv_bytes*8/(interval*1000000000.):.2f} Gb/s")
36 rcv_pkts = 0
37 rcv_bytes = 0
38 start_time = stop_time
39 except KeyboardInterrupt:
40 break
41 except:
42 continue
43 console.log(f"Received {rcv_pkts_tot} messages; ending now.")
44

Variable Documentation

◆ console

wib_packet_receiver.console = Console()

Definition at line 8 of file wib_packet_receiver.py.

◆ CONTEXT_SETTINGS

wib_packet_receiver.CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])

Definition at line 10 of file wib_packet_receiver.py.

◆ show_default

wib_packet_receiver.show_default

Definition at line 47 of file wib_packet_receiver.py.

◆ standalone_mode

wib_packet_receiver.standalone_mode

Definition at line 47 of file wib_packet_receiver.py.

◆ True

wib_packet_receiver.True

Definition at line 47 of file wib_packet_receiver.py.