.protocol Property


For the currently selected socket (selection is made through sock.num), selects the transport protocol.


Enum (pl_sock_protocol, byte)

Value Range:

  • 0 — PL_SOCK_PROTOCOL_UDP (default): UDP transport protocol.
  • 1 — PL_SOCK_PROTOCOL_TCP: TCP transport protocol.

See Also:



Note that there is no "HTTP" selection, as HTTP is not a transport protocol (TCP is the transport protocol required by HTTP). You make the socket accept HTTP connections by specifying the list of HTTP listening ports using the sock.httpportlist property or using the sock.httpmode property.

The program won't be able to change the value of this property when the socket is not idle (sock.statesimple <> 0 — PL_SSTS_CLOSED).

.protocol Property