- Comments
- D
- Search
- Home

Last update Sun Jul 22 16:19:29 2007

# 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

class SocketStream: std.stream.Stream;
  SocketStream is a stream for a blocking, connected Socket.
  this(Socket sock, FileMode mode);
    Constructs a SocketStream with the specified Socket and FileMode flags.
  this(Socket sock);
    Uses mode FileMode.In | FileMode.Out.
  Socket socket();
    Property to get the Socket that is being streamed.
  uint readBlock(void* _buffer, uint size);
    Attempts to read the entire block, waiting if necessary.
  uint writeBlock(const(void)* _buffer, uint size);
    Attempts to write the entire block, waiting if necessary.
  ulong seek(long offset, SeekPos whence);
  const(char)[] toString();
    Does not return the entire stream because that would require the remote connection to be closed.
  void close();
    Close the Socket.

Copyright © 1999-2007 by Digital Mars, All Rights Reserved | Page generated by Ddoc.