On this page
socket.SocketKind
Prev: socket.socket | Up: socket | Next: socket.socketpair
Rel: socket.AddressFamily, socket.close, socket.create_connection, socket.create_server
Ref: docs.python.org — socket.SocketKind
Tags: #public #python3 #stdlib #socket
Import
import socket
from socket import SocketKind
Signature & Overview
socket.SocketKind(*values)
An enumeration.
Methods & Attributes
SocketKind.as_integer_ratio(self, /)— Return a pair of integers, whose ratio is equal to the original int.SocketKind.bit_count(self, /)— Number of ones in the binary representation of the absolute value of self.SocketKind.bit_length(self, /)— Number of bits necessary to represent self in binary.SocketKind.conjugate(self, /)— Returns self, the complex conjugate of any int.SocketKind.from_bytes(bytes, byteorder='big', *, signed=False)— Return the integer represented by the given array of bytes.SocketKind.is_integer(self, /)— Returns True. Exists for duck type compatibility with float.is_integer.SocketKind.to_bytes(self, /, length=1, byteorder='big', *, signed=False)— Return an array of bytes representing an integer.
Usage
import socket
assert isinstance(socket.SOCK_STREAM, socket.SocketKind)
assert socket.SOCK_DGRAM.name == "SOCK_DGRAM"
Gotchas
SOCK_STREAM= TCP,SOCK_DGRAM= UDP: Passed as the second argument tosocket.socket().
REPL Inspect
from socket import SocketKind
help(SocketKind)
Linked from
Related notes
- tuts/python3/stdlib_module/socket/socket Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/socketpair Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/AddressFamily Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/close Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/create_connection Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/create_server Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/socket/dup shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/error shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/fromfd shared tags: #socket, #stdlib