This is a file-like class that wraps a GSITCPSocket.
Methods
|
|
__init__
close
flush
read
readline
shutdown
write
|
|
__init__
|
__init__ (
self,
sock,
mode,
)
Initialize a GSIFile class. the sock argument should be a GSITCPSocket.
The mode argument is interpreted as for a file object, except that only
r and w are meaningful.
|
|
close
|
close ( self )
Close the associated socket.
|
|
flush
|
flush ( self )
In theory, flush any pending output. In practice, this does nothing.
|
|
read
|
read (
self,
size=0,
waitForBytes=1,
)
Read size bytes, returning a string.
Exceptions
|
|
IOError, "File not open for reading"
RuntimeException, "waitForBytes is larger than buffer_size"
|
|
|
readline
|
readline ( self )
Read a line, and return it.
|
|
shutdown
|
shutdown ( self, n )
Shutdown the associated socket.
|
|
write
|
write ( self, str )
Write a string to the socket.
|
|