当前位置: 首页>>代码示例>>Python>>正文


Python socket.recv_into函数代码示例

本文整理汇总了Python中socket.socket.recv_into函数的典型用法代码示例。如果您正苦于以下问题:Python recv_into函数的具体用法?Python recv_into怎么用?Python recv_into使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了recv_into函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: recv_into

 def recv_into(self, buffer, nbytes = 0, flags = 0, raw = False):
     if not raw:
         if nbytes == 0:
             nbytes = len(buffer)
         data = self.recv(nbytes, flags)
         length = len(data)
         buffer[:length] = data
         return length
     else:
         return socket.recv_into(self, buffer, nbytes, flags)
开发者ID:lsowen,项目名称:pySchannelSSL,代码行数:10,代码来源:sslsocket.py

示例2: recv_into

 def recv_into(self, buffer, nbytes=None, flags=0):
     self._checkClosed()
     if buffer and nbytes is None:
         nbytes = len(buffer)
     elif nbytes is None:
         nbytes = 1024
     if self._sslobj:
         if flags != 0:
             raise ValueError('non-zero flags not allowed in calls to recv_into() on %s' % self.__class__)
         return self.read(nbytes, buffer)
     return socket.recv_into(self, buffer, nbytes, flags)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:11,代码来源:ssl.py

示例3: recv_into

 def recv_into(self, buffer, nbytes=None, flags=0):
     if buffer and (nbytes is None):
         nbytes = len(buffer)
     elif nbytes is None:
         nbytes = 1024
     if self._sslobj:
         if flags != 0:
             raise ValueError("non-zero flags not allowed in calls to recv_into() on %s" % self.__class__)
         tmp_buffer = self.read(nbytes)
         v = len(tmp_buffer)
         buffer[:v] = tmp_buffer
         return v
     else:
         return socket.recv_into(self, buffer, nbytes, flags)
开发者ID:Jaykul,项目名称:ChocolateyPackages,代码行数:14,代码来源:ssl.py

示例4: ValueError

                raise ValueError(
                  "non-zero flags not allowed in calls to recv_into() on %s" %
                  self.__class__)
            while True:
                try:
                    tmp_buffer = self.read(nbytes)
                    v = len(tmp_buffer)
                    buffer[:v] = tmp_buffer
                    return v
                except SSLError, x:
                    if x.args[0] == SSL_ERROR_WANT_READ:
                        continue
                    else:
                        raise x
        else:
            return socket.recv_into(self, buffer, nbytes, flags)

    def recvfrom (self, addr, buflen=1024, flags=0):
        if self._sslobj:
            raise ValueError("recvfrom not allowed on instances of %s" %
                             self.__class__)
        else:
            return socket.recvfrom(self, addr, buflen, flags)

    def recvfrom_into (self, buffer, nbytes=None, flags=0):
        if self._sslobj:
            raise ValueError("recvfrom_into not allowed on instances of %s" %
                             self.__class__)
        else:
            return socket.recvfrom_into(self, buffer, nbytes, flags)
开发者ID:maximerobin,项目名称:Ufwi,代码行数:30,代码来源:ssl.py


注:本文中的socket.socket.recv_into函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。