|
|
## Cython Interface
|
|
|
## C/C++
|
|
|
|
|
|
**TODO**
|
|
|
|
|
|
## Limitations
|
|
|
* Packet lengths are not necessarily sustained, as block coding requires padding of packets. The application layer protocol running on top of PRRT has to include custom mechanisms for framing (termination character, length field). |
|
|
\ No newline at end of file |
|
|
## Python
|
|
|
|
|
|
First, import prrt as:
|
|
|
|
|
|
```python
|
|
|
import prrt
|
|
|
```
|
|
|
|
|
|
Open a socket as a receiver:
|
|
|
|
|
|
```python
|
|
|
r = prrt.PrrtSocket(port=5000, isSender=False)
|
|
|
```
|
|
|
|
|
|
|
|
|
Open a socket as a sender:
|
|
|
|
|
|
```python
|
|
|
s = prrt.PrrtSocket(port=port, isSender=True)
|
|
|
s.connect(host, port)
|
|
|
```
|
|
|
|
|
|
The data can be received on the receiver by:
|
|
|
|
|
|
```python
|
|
|
data = r.recv()
|
|
|
``` |
|
|
\ No newline at end of file |