Python-like example::
c.start(ports = [0, 1], mult = "5mpps", duration = 10)
+
+ c.start(ports = [0, 1], mult = "5mpps", duration = 10, core_mask = [0x1,0xe] )
+
+ c.start(ports = [0, 1], mult = "5mpps", duration = 10, core_mask = core_mask=STLClient.CORE_MASK_PIN )
Console-like example::
c.disconnect()
+
.. code-block:: python
:caption: Example 2: Client can execute other functions while the TRex server is generating traffic
c.disconnect()
+.. code-block:: python
+ :caption: Example 5: pin cores to ports
+
+ c = STLClient()
+
+ try:
+ # connect to server
+ c.connect()
+
+ # prepare our ports (my machine has 0 <--> 1 with static route)
+ c.reset(ports = [0, 1])
+
+ # add both streams to ports
+ c.add_streams(s1, ports = [0])
+
+ # clear the stats before injecting
+ c.clear_stats()
+
+ c.start(ports = [0, 1], mult = "5mpps", duration = 10, core_mask = [0x1,0x2]) # pin core to ports for better performance
+
+ # block until done
+ c.wait_on_traffic(ports = [0, 1])
+
+ # check for any warnings
+ if c.get_warnings():
+ # handle warnings here
+ pass
+
+ finally:
+ c.disconnect()
+