# Poco::Net

# class SocketIOS

Library: Net
Package: Sockets
Header: Poco/Net/SocketStream.h

## Description

The base class for SocketStream, SocketInputStream and SocketOutputStream.

This class is needed to ensure the correct initialization order of the stream buffer and base classes.

## Inheritance

Direct Base Classes: std::ios

All Base Classes: std::ios

Known Derived Classes: SocketOutputStream, SocketInputStream, SocketStream

## Member Summary

Member Functions: close, rdbuf, socket

## Constructors

### SocketIOS

SocketIOS(
const Socket & socket
);

Creates the SocketIOS with the given socket.

The socket's SocketImpl must be a StreamSocketImpl, otherwise an InvalidArgumentException is thrown.

## Destructor

### ~SocketIOS

~SocketIOS();

Destroys the SocketIOS.

Flushes the buffer, but does not close the socket.

## Member Functions

### close

void close();

Flushes the stream and closes the socket.

### rdbuf

SocketStreamBuf * rdbuf();

Returns a pointer to the internal SocketStreamBuf.

### socket

StreamSocket socket() const;

Returns the underlying socket.

## Variables

### _buf

SocketStreamBuf _buf;