Network¶
- class Network(self)¶
Bases:
pybind11_object
This class represents a Transmission Control Protocol (TCP) network.
TCP provides reliable, ordered delivery of a stream of bytes from a program on one computer to another program on another computer.
Warning
This class shouldn’t be used directly. You better use vpClient and vpServer to simulate your network. Some examples are provided in these classes.
Note
See vpServer
Note
See vpNetwork
Methods
Get the maximum size that the emitter can receive (in request mode).
Get the receptor index from its name.
Get the Id of the request at the index ind.
Print the receptors.
Receives and decode requests until there is requests to receive.
Receives and decode requests, from a specific emitter, until there is request to receive.
Receives a message once (in the limit of the Maximum message size value).
Receives a message once (in the limit of the Maximum message size value), from a specific emitter.
Receive requests until there is requests to receive.
Receives requests, from a specific emitter, until there is request to receive.
Receives a message once (in the limit of the Maximum message size value).
Receives a message once (in the limit of the Maximum message size value), from a specific emitter.
Delete a decoding request from the emitter.
Send and encode a request to the first receptor in the list.
Send and encode a request to a specific receptor.
Send a request to the first receptor in the list.
Send a request to a specific receptor.
Change the maximum size that the emitter can receive (in request mode).
Change the time the emitter spend to check if he receives a message from a receptor.
Change the time the emitter spend to check if he receives a message from a receptor.
Set the verbose mode.
Inherited Methods
Operators
__annotations__
__doc__
__module__
Attributes
__annotations__
- __init__(self)¶
- getMaxSizeReceivedMessage(self) int ¶
Get the maximum size that the emitter can receive (in request mode).
- Returns:
Acutal max size value.
- getReceptorIndex(self, name: str) int ¶
Get the receptor index from its name. The name can be either the IP, or its name on the network.
- print(self: visp._visp.core.Network, id: str =) None ¶
Print the receptors.
- Parameters:
- id
Message to display before the receptor’s index.
- receiveAndDecodeRequest(self) list[int] ¶
Receives and decode requests until there is requests to receive.
Warning
Requests will be received but not decoded.
Note
See vpNetwork::receive()
Note
See vpNetwork::receiveRequestFrom()
Note
See vpNetwork::receiveRequestOnce()
Note
See vpNetwork::receiveRequestOnceFrom()
Note
See vpNetwork::receiveAndDecodeRequest()
Note
See vpNetwork::receiveAndDecodeRequestFrom()
Note
See vpNetwork::receiveAndDecodeRequestOnce()
Note
See vpNetwork::receiveAndDecodeRequestOnceFrom()
- receiveAndDecodeRequestFrom(self, receptorEmitting: int) list[int] ¶
Receives and decode requests, from a specific emitter, until there is request to receive.
Warning
Requests will be received but not decoded.
Note
See vpNetwork::receive()
Note
See vpNetwork::receiveRequest()
Note
See vpNetwork::receiveRequestOnce()
Note
See vpNetwork::receiveRequestOnceFrom()
Note
See vpNetwork::receiveAndDecodeRequest()
Note
See vpNetwork::receiveAndDecodeRequestFrom()
Note
See vpNetwork::receiveAndDecodeRequestOnce()
Note
See vpNetwork::receiveAndDecodeRequestOnceFrom()
- receiveAndDecodeRequestOnce(self) int ¶
Receives a message once (in the limit of the Maximum message size value). This message can represent an entire request or not. Several calls to this function might be necessary to get the entire request. If it represents an entire request, it decodes the request.
- Returns:
The number of bytes received, -1 if an error occured.
- receiveAndDecodeRequestOnceFrom(self, receptorEmitting: int) int ¶
Receives a message once (in the limit of the Maximum message size value), from a specific emitter. This message can represent an entire request or not. Several calls to this function might be necessary to get the entire request. If it represents an entire request, it decodes the request.
- receiveRequest(self) list[int] ¶
Receive requests until there is requests to receive.
Warning
Requests will be received but not decoded.
Note
See vpNetwork::receive()
Note
See vpNetwork::receiveRequestFrom()
Note
See vpNetwork::receiveRequestOnce()
Note
See vpNetwork::receiveRequestOnceFrom()
Note
See vpNetwork::receiveAndDecodeRequest()
Note
See vpNetwork::receiveAndDecodeRequestFrom()
Note
See vpNetwork::receiveAndDecodeRequestOnce()
Note
See vpNetwork::receiveAndDecodeRequestOnceFrom()
- receiveRequestFrom(self, receptorEmitting: int) list[int] ¶
Receives requests, from a specific emitter, until there is request to receive.
Warning
Requests will be received but not decoded.
Note
See vpNetwork::receive()
Note
See vpNetwork::receiveRequest()
Note
See vpNetwork::receiveRequestOnce()
Note
See vpNetwork::receiveRequestOnceFrom()
Note
See vpNetwork::receiveAndDecodeRequest()
Note
See vpNetwork::receiveAndDecodeRequestFrom()
Note
See vpNetwork::receiveAndDecodeRequestOnce()
Note
See vpNetwork::receiveAndDecodeRequestOnceFrom()
- receiveRequestOnce(self) int ¶
Receives a message once (in the limit of the Maximum message size value). This message can represent an entire request or not. Several calls to this function might be necessary to get the entire request.
- Returns:
The number of bytes received, -1 if an error occured.
- receiveRequestOnceFrom(self, receptorEmitting: int) int ¶
Receives a message once (in the limit of the Maximum message size value), from a specific emitter. This message can represent an entire request or not. Several calls to this function might be necessary to get the entire request.
- removeDecodingRequest(self, arg0: str) None ¶
Delete a decoding request from the emitter.
Note
See vpNetwork::addDecodingRequest()
- sendAndEncodeRequest(self, req: visp._visp.core.Request) int ¶
Send and encode a request to the first receptor in the list.
- Parameters:
- req: visp._visp.core.Request¶
Request to send.
- Returns:
The number of bytes that have been sent, -1 if an error occured.
- sendAndEncodeRequestTo(self, req: visp._visp.core.Request, dest: int) int ¶
Send and encode a request to a specific receptor.
- Parameters:
- req: visp._visp.core.Request¶
Request to send.
- dest: int¶
Index of the receptor receiving the request.
- Returns:
The number of bytes that have been sent, -1 if an error occured.
- sendRequest(self, req: visp._visp.core.Request) int ¶
Send a request to the first receptor in the list.
- Parameters:
- req: visp._visp.core.Request¶
Request to send.
- Returns:
The number of bytes that have been sent, -1 if an error occured.
- sendRequestTo(self, req: visp._visp.core.Request, dest: int) int ¶
Send a request to a specific receptor.
- Parameters:
- req: visp._visp.core.Request¶
Request to send.
- dest: int¶
Index of the receptor receiving the request.
- Returns:
The number of bytes that have been sent, -1 if an error occured.
- setMaxSizeReceivedMessage(self, s: int) None ¶
Change the maximum size that the emitter can receive (in request mode).
Note
See vpNetwork::getMaxSizeReceivedMessage()
- setTimeoutSec(self, sec: int) None ¶
Change the time the emitter spend to check if he receives a message from a receptor. Initially this value is set to 10usec.
Note
See vpNetwork::setTimeoutUSec()