hio.core.wms.wmsing =================== .. py:module:: hio.core.wms.wmsing .. autoapi-nested-parse:: hio.core.wms.wmsing Module WinMailSlots as datagram transport Module Contents --------------- .. py:class:: Peer(*, umask=None, bc=None, bs=None, wl=None, reopen=False, clear=True, filed=False, extensioned=True, **kwa) Bases: :py:obj:`hio.base.filing.Filer` Class to manage reliable datagram transport on Windows using Mailslots instead of unix domain sockets. WinMailSlot (wms) Because win-mail-slots (wms) are reliable no need for retry timer. Because win-mail-slots do not attach the source address we have to embed the source address in the memogram header. So we need a new memogram header code for wms as reliable transport replacement for uxd on Windows. Inherited Class Attributes: HeadDirPath (str): default abs dir path head such as "/usr/local/var" TailDirPath (str): default rel dir path tail when using head CleanTailDirPath (str): default rel dir path tail when creating clean AltHeadDirPath (str): default alt dir path head such as "~" as fallback when desired head not permitted. AltTailDirPath (str): default alt rel dir path tail as fallback when using alt head. AltCleanTailDirPath (str): default alt rel path tail when creating clean TempHeadDir (str): default temp abs dir path head such as "/tmp" TempPrefix (str): default rel dir path prefix when using temp head TempSuffix (str): default rel dir path suffix when using temp head and tail Perm (int): explicit default octal perms such as 0o1700 Mode (str): open mode such as "r+" Fext (str): default file extension such as "text" for "fname.text" Inherited Attributes: name (str): unique path component used in directory or file path name base (str): another unique path component inserted before name temp (bool): True means use TempHeadDir in /tmp directory headDirPath (str): head directory path path (str or None): full directory or file path once created else None perm (int): numeric os permissions for directory and/or file(s) filed (bool): True means .path ends in file; False means .path ends in directory. mode (str): file open mode if filed fext (str): file extension if filed file (File or None): File instance when filed and created. opened (bool): True means directory path, uxd file, and socket are created and opened; False otherwise. Class Attributes: Umask (int): octal default umask permissions such as 0o022 MaxGramSize (int): max bytes in in datagram for this transport BufSize (int): used to set buffer size for transport datagram buffers .. attribute:: umask permission mask for uxd file, usually octal 0o022; .umask is applied after .perm is set if any. :type: int .. attribute:: bc count of transport buffers of MaxGramSize :type: int or None .. attribute:: bs buffer size of transport buffers. When .bc then .bs is calculated by multiplying (.bs = .bc * .MaxGramSize). When .bc is None then .bs is provided value or default .BufSize. :type: int .. attribute:: wl instance ref for debug logging of over the wire tx and rx :type: WireLog .. attribute:: ls local slot of this Peer :type: socket.socket .. py:method:: open() Opens mailslot in nonblocking mode .. py:method:: reopen() Clear the ms and reopen .. py:method:: close() Close the mailslot .. py:method:: receive() Perform a non-blocking read on the mailslot :returns: (data, sa). If no data, returns (b'', None), but always returns a tuple with 2 elements. :rtype: tuple .. rubric:: Notes win32file.ReadFile returns a tuple: (errcode, data). .. py:method:: send(data, dest) Perform a non-blocking write on the mailslot data is string in python2 and bytes in python3 dest is destination mailslot path :param data: to send :type data: bytes :param dest: destination mailslot :type dest: Mailslot