std.socketstream
SocketStream
is a stream for a blocking, connected
Socket
.
For Win32 systems, link with
ws2_32.lib
.
Example:
See
/dmd/samples/d/htmlget.d
Authors:
Christopher E. Miller
References:
std.stream
Classes
SocketStream
:
Stream
SocketStream
is a stream for a blocking, connected
Socket
.
Super hierarchy:
Object
->
Stream
->
SocketStream
All implemented interfaces:
InputStream
,
OutputStream
Constructors
this
(
Socket
sock
,
FileMode
mode
)
Constructs a SocketStream with the specified Socket and FileMode flags.
Methods
void
close
()
Close the
Socket
.
uint
readBlock
(
void
*
_buffer
,
uint
size
)
Attempts to read the entire block, waiting if necessary.
ulong
seek
(
long
offset
,
SeekPos
whence
)
Socket
socket
()
Property to get the
Socket
that is being streamed.
char
[]
toString
()
Does not return the entire stream because that would require the remote connection to be closed.
uint
writeBlock
(
void
*
_buffer
,
uint
size
)
Attempts to write the entire block, waiting if necessary.
Inherited methods
from
Object
:
factory
,
notifyRegister
,
notifyUnRegister
,
opCmp
,
opEquals
,
print
,
toHash
,
toString
from
Stream
:
available
,
close
,
copyFrom
,
eof
,
flush
,
getc
,
getcw
,
isOpen
,
opApply
,
position
,
printf
,
read
,
readBlock
,
readExact
,
readf
,
readLine
,
readLineW
,
readString
,
readStringW
,
seek
,
seekCur
,
seekEnd
,
seekSet
,
size
,
toHash
,
toString
,
ungetAvailable
,
ungetc
,
ungetcw
,
vprintf
,
vreadf
,
write
,
writeBlock
,
writeExact
,
writef
,
writefln
,
writefx
,
writeLine
,
writeLineW
,
writeString
,
writeStringW
from
InputStream
:
available
,
eof
,
getc
,
getcw
,
isOpen
,
opApply
,
read
,
readExact
,
readf
,
readLine
,
readLineW
,
readString
,
readStringW
,
ungetc
,
ungetcw
,
vreadf
from
OutputStream
:
close
,
flush
,
isOpen
,
printf
,
vprintf
,
write
,
writeExact
,
writef
,
writefln
,
writefx
,
writeLine
,
writeLineW
,
writeString
,
writeStringW