class documentation
class ReceivableProtocol(Protocol):
Constructor: ReceivableProtocol(recv, write, close, report_activity, ...)
Variant of Protocol that allows reading up to a size without blocking.
This class has a recv() method that behaves like socket.recv() in addition to a read() method.
If you want to read n bytes from the wire and block until exactly n bytes (or EOF) are read, use read(n). If you want to read at most n bytes from the wire but don't care if you get less, use recv(n). Note that recv(n) will still block until at least one byte is read.
| Method | __init__ |
Initialize ReceivableProtocol. |
| Method | read |
Read bytes from the socket. |
| Method | recv |
Receive bytes from the socket with buffering. |
| Instance Variable | _rbuf |
Undocumented |
| Instance Variable | _rbufsize |
Undocumented |
| Instance Variable | _recv |
Undocumented |
Inherited from Protocol:
| Method | __del__ |
Ensure transport is closed when Protocol is garbage collected. |
| Method | __enter__ |
Enter context manager. |
| Method | __exit__ |
Exit context manager and close transport. |
| Method | close |
Close the underlying transport if a close function was provided. |
| Method | eof |
Test whether the protocol stream has reached EOF. |
| Method | read |
Read a command and some arguments from the git client. |
| Method | read |
Reads a pkt-line from the remote git process. |
| Method | read |
Read a sequence of pkt-lines from the remote git process. |
| Method | send |
Send a command and some arguments to a git server. |
| Method | unread |
Unread a single line of data into the readahead buffer. |
| Method | write |
Sends a pkt-line to the remote git process. |
| Method | write |
Write multiplexed data to the sideband. |
| Instance Variable | report |
Undocumented |
| Instance Variable | write |
Undocumented |
| Instance Variable | _close |
Undocumented |
| Instance Variable | _readahead |
Undocumented |
def __init__(self, recv:
Callable[ [ int], bytes], write: Callable[ [ bytes], int | None], close: Callable[ [], None] | None = None, report_activity: Callable[ [ int, str], None] | None = None, rbufsize: int = _RBUFSIZE):
¶
overrides
dulwich.protocol.Protocol.__init__Initialize ReceivableProtocol.
| Parameters | |
recv:Callable[ | Function to receive bytes from the transport |
write:Callable[ | Function to write bytes to the transport |
close:Callable[ | Optional function to close the transport |
reportCallable[ | Optional function to report activity |
rbufsize:int | Read buffer size |