Package wsgitools :: Package scgi :: Module forkpool :: Class SocketFileWrapper
[hide private]
[frames] | no frames]

Class SocketFileWrapper

source code


Wraps a socket to a wsgi-compliant file-like object.

Instance Methods [hide private]
 
__init__(self, sock, toread)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_recv(self, size=4096)
internal method for receiving and counting incoming data
source code
 
close(self)
Does not close the socket, because it might still be needed.
source code
 
read(self, size=None)
see pep333
source code
 
readline(self, size=None)
see pep333
source code
 
readlines(self)
see pep333
source code
 
__iter__(self)
see pep333
source code
 
__next__(self)
see pep333
source code
 
next(self) source code
 
flush(self)
see pep333
source code
 
write(self, data)
see pep333
source code
 
writelines(self, lines)
see pep333
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, sock, toread)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • sock - is a socket.socket()
Overrides: object.__init__

_recv(self, size=4096)

source code 

internal method for receiving and counting incoming data

Raises:
  • socket.error

close(self)

source code 

Does not close the socket, because it might still be needed. It reads all data that should have been read as given by CONTENT_LENGTH.

read(self, size=None)

source code 

see pep333

Raises:
  • socket.error

readline(self, size=None)

source code 

see pep333

Raises:
  • socket.error

readlines(self)

source code 

see pep333

Raises:
  • socket.error

__next__(self)

source code 

see pep333

Raises:
  • socket.error