本文整理汇总了Python中socket._fileobject函数的典型用法代码示例。如果您正苦于以下问题:Python _fileobject函数的具体用法?Python _fileobject怎么用?Python _fileobject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_fileobject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup
def setup(self):
"""Override SocketServer.StreamRequestHandler.setup."""
self.connection = self.request
self.rfile = memorizingfile.MemorizingFile(
socket._fileobject(self.request, 'rb', self.rbufsize),
max_memorized_lines=self._MAX_MEMORIZED_LINES)
self.wfile = socket._fileobject(self.request, 'wb', self.wbufsize)
示例2: setup
def setup(self):
if self.server.cert_file:
self.connection = self.request
self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
else:
WSGIRequestHandler.setup(self)
示例3: setup
def setup(self):
self.connection = self.request
self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
print self.rfile
print self.wfile
示例4: setup
def setup(self):
self.connection = self.request
self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
#トランザクションログ・トランザクションデータログ用のロガー
self._logger = logging.getLogger('vhut.tran')
self._logger_data = logging.getLogger('vhut.trandata')
示例5: makefile
def makefile(self, mode='r', bufsize=-1):
self.__makefile_refs += 1
try:
return socket._fileobject(self, mode, bufsize, close=True)
except TypeError:
# Python 2.2 compatibility hacks.
return socket._fileobject(self, mode, bufsize)
示例6: __init__
def __init__(self, sock, client, args):
self.connection = sock
self.rfile = socket._fileobject(self.connection, "rb", self.rbufsize)
self.wfile = socket._fileobject(self.connection, "wb", self.wbufsize)
self.client_address = client
self.args = args
self.setup()
示例7: setup
def setup(self):
"""Setup the connection."""
self.connection = self.request
if trace: print 'SETUP', self.connection
self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
if trace: print 'AFTER', self.rfile, self.wfile
示例8: setup
def setup(self):
self.connection = self.request
if self.server.sslOpts:
self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
else:
self.rfile = self.connection.makefile('rb', self.rbufsize)
self.wfile = self.connection.makefile('wb', self.wbufsize)
示例9: __init__
def __init__(self, sock, client, args):
self.conn = sock
self.rfile = socket._fileobject(self.conn, "rb", -1)
self.wfile = socket._fileobject(self.conn, "wb", 0)
self.client_address = client
self.read_buffer = ""
self.buffer_start = 0
示例10: setup
def setup(self):
self.suppress_body = False
if self.server.enable_ssl:
self.connection = self.request
self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
else:
SimpleXMLRPCRequestHandler.setup(self)
示例11: setup
def setup(self):
"""initial connection setup, setting rfile, wfile, and connection"""
if hasattr(self.request, 'do_handshake'): #ssl mode
self.connection = self.request
self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
else:
httpserver.BaseHTTPRequestHandler.setup(self)
示例12: makefile
def makefile(self, mode='rb', bufsize=-1):
log.debug('self.socket = %s, mode = "%s", bufsize = %d',
self.socket, mode, bufsize)
if not six.PY3:
return socket._fileobject(self, mode, bufsize)
else:
# FIXME This is nonsense, I know, it is here just as filling
return socket._fileobject(self, mode, bufsize)
示例13: setup
def setup(self):
self.connection = self.request
if self.timeout is not None:
self.connection.settimeout(self.timeout)
if self.disable_nagle_algorithm:
self.connection.setsockopt(socket.IPPROTO_TCP,
socket.TCP_NODELAY, True)
self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
示例14: setup
def setup(self):
if self.server.config.get('server', 'https') == '1':
self.rfile = socket._fileobject(self.request, "rb", self.rbufsize)
self.wfile = socket._fileobject(self.request, "wb", self.wbufsize)
else:
SocketServer.StreamRequestHandler.setup(self)
# wrap the wfile with a class that will eat up "Broken pipe" errors
self.wfile = _SocketWriter(self.wfile)
示例15: setup
def setup(self):
self.connection = self.request
if self.server.is_https:
# TODO(user): SSL.Connection.makefile() raises NotImplemented - why?
self.rfile = socket._fileobject(self.request, 'rb', self.rbufsize)
self.wfile = socket._fileobject(self.request, 'wb', self.wbufsize)
else:
self.rfile = self.connection.makefile('rb', self.rbufsize)
self.wfile = self.connection.makefile('wb', self.wbufsize)