Sends a `Packet` object :param x: `Packet` to be send :return: Number of bytes that have been sent
(self, x)
| 101 | self.iface = iface or conf.iface |
| 102 | |
| 103 | def send(self, x): |
| 104 | # type: (Packet) -> int |
| 105 | """Sends a `Packet` object |
| 106 | |
| 107 | :param x: `Packet` to be send |
| 108 | :return: Number of bytes that have been sent |
| 109 | """ |
| 110 | sx = raw(x) |
| 111 | try: |
| 112 | x.sent_time = time.time() |
| 113 | except AttributeError: |
| 114 | pass |
| 115 | |
| 116 | if self.outs: |
| 117 | return self.outs.send(sx) |
| 118 | else: |
| 119 | return 0 |
| 120 | |
| 121 | if WINDOWS: |
| 122 | def _recv_raw(self, sock, x): |