SSWriter
from panda3d.core import SSWriter
- class SSWriter
Bases:
DTOOL_SUPER_BASE
An internal class for writing to a socket stream. This serves as a base class for both OSocketStream and SocketStream; its purpose is to minimize redundant code between them. Do not use it directly.
Inheritance diagram
- __init__(*args, **kwargs)
- close()
C++ Interface: close(const SSWriter self)
- considerFlush()
C++ Interface: consider_flush(const SSWriter self)
- /**
Sends the most recently queued data if enough time has elapsed. This only
has meaning if set_collect_tcp() has been set to true.
*/
- consider_flush()
C++ Interface: consider_flush(const SSWriter self)
- /**
Sends the most recently queued data if enough time has elapsed. This only
has meaning if set_collect_tcp() has been set to true.
*/
- flush()
C++ Interface: flush(const SSWriter self)
- /**
Sends the most recently queued data now. This only has meaning if
set_collect_tcp() has been set to true.
*/
- getCollectTcp()
C++ Interface: get_collect_tcp(SSWriter self)
- /**
Returns the current setting of “collect-tcp” mode. See set_collect_tcp().
*/
- getCollectTcpInterval()
C++ Interface: get_collect_tcp_interval(SSWriter self)
- /**
Returns the interval in time, in seconds, for which to hold TCP packets
before sending all of the recently received packets at once. This only has
meaning if “collect-tcp” mode is enabled; see set_collect_tcp().
*/
- getTcpHeaderSize()
C++ Interface: get_tcp_header_size(SSWriter self)
- /**
Returns the header size for datagrams. See set_tcp_header_size().
*/
- get_collect_tcp()
C++ Interface: get_collect_tcp(SSWriter self)
- /**
Returns the current setting of “collect-tcp” mode. See set_collect_tcp().
*/
- get_collect_tcp_interval()
C++ Interface: get_collect_tcp_interval(SSWriter self)
- /**
Returns the interval in time, in seconds, for which to hold TCP packets
before sending all of the recently received packets at once. This only has
meaning if “collect-tcp” mode is enabled; see set_collect_tcp().
*/
- get_tcp_header_size()
C++ Interface: get_tcp_header_size(SSWriter self)
- /**
Returns the header size for datagrams. See set_tcp_header_size().
*/
- isClosed()
C++ Interface: is_closed(const SSWriter self)
- is_closed()
C++ Interface: is_closed(const SSWriter self)
- sendDatagram()
C++ Interface: send_datagram(const SSWriter self, const Datagram dg)
- /**
Transmits the indicated datagram over the socket by prepending it with a
little-endian 16-bit byte count. Does not return until the data is sent or
the connection is closed, even if the socket stream is non-blocking.
*/
- send_datagram()
C++ Interface: send_datagram(const SSWriter self, const Datagram dg)
- /**
Transmits the indicated datagram over the socket by prepending it with a
little-endian 16-bit byte count. Does not return until the data is sent or
the connection is closed, even if the socket stream is non-blocking.
*/
- setCollectTcp()
C++ Interface: set_collect_tcp(const SSWriter self, bool collect_tcp)
- /**
Enables or disables “collect-tcp” mode. In this mode, individual TCP
packets are not sent immediately, but rather they are collected together
and accumulated to be sent periodically as one larger TCP packet. This
cuts down on overhead from the TCP/IP protocol, especially if many small
packets need to be sent on the same connection, but it introduces
additional latency (since packets must be held before they can be sent).
See set_collect_tcp_interval() to specify the interval of time for which to
hold packets before sending them.
If you enable this mode, you may also need to periodically call
consider_flush() to flush the queue if no packets have been sent recently.
*/
- setCollectTcpInterval()
C++ Interface: set_collect_tcp_interval(const SSWriter self, double interval)
- /**
Specifies the interval in time, in seconds, for which to hold TCP packets
before sending all of the recently received packets at once. This only has
meaning if “collect-tcp” mode is enabled; see set_collect_tcp().
*/
- setTcpHeaderSize()
C++ Interface: set_tcp_header_size(const SSWriter self, int tcp_header_size)
- /**
Sets the header size for datagrams. At the present, legal values for this
are 0, 2, or 4; this specifies the number of bytes to use encode the
datagram length at the start of each TCP datagram. Sender and receiver
must independently agree on this.
*/
- set_collect_tcp()
C++ Interface: set_collect_tcp(const SSWriter self, bool collect_tcp)
- /**
Enables or disables “collect-tcp” mode. In this mode, individual TCP
packets are not sent immediately, but rather they are collected together
and accumulated to be sent periodically as one larger TCP packet. This
cuts down on overhead from the TCP/IP protocol, especially if many small
packets need to be sent on the same connection, but it introduces
additional latency (since packets must be held before they can be sent).
See set_collect_tcp_interval() to specify the interval of time for which to
hold packets before sending them.
If you enable this mode, you may also need to periodically call
consider_flush() to flush the queue if no packets have been sent recently.
*/
- set_collect_tcp_interval()
C++ Interface: set_collect_tcp_interval(const SSWriter self, double interval)
- /**
Specifies the interval in time, in seconds, for which to hold TCP packets
before sending all of the recently received packets at once. This only has
meaning if “collect-tcp” mode is enabled; see set_collect_tcp().
*/
- set_tcp_header_size()
C++ Interface: set_tcp_header_size(const SSWriter self, int tcp_header_size)
- /**
Sets the header size for datagrams. At the present, legal values for this
are 0, 2, or 4; this specifies the number of bytes to use encode the
datagram length at the start of each TCP datagram. Sender and receiver
must independently agree on this.
*/