clan::TCPListen Class Reference - ClanLib SDK
Description: clan::TCPListen Class Reference

Public Member Functions | Protected Member Functions | List of all members
clan::TCPListen Class Reference

Listens for incoming TCP/IP socket connections. More...

`#include <tcp_listen.h>`

Inheritance diagram for clan::TCPListen:

## Public Member Functions
| TCPListen ()
| Create null object.
| TCPListen (const SocketName &endpoint, int backlog=5, bool reuse_address=true)
| Create a listening socket for the specified end point.
| ~TCPListen ()
TCPConnection | accept (SocketName &end_point)
| Accept an incoming connection.
void | close ()
| Stops listening for incoming messages and closes the socket.
bool | is_null () const
| Returns true if it is a null object.

## Protected Member Functions
SocketHandle * | get_socket_handle () override

## Detailed Description

Listens for incoming TCP/IP socket connections.

## Constructor & Destructor Documentation

## ◆ TCPListen() [1/2]

clan::TCPListen::TCPListen | ( |  | ) |

Create null object.

## ◆ TCPListen() [2/2]

clan::TCPListen::TCPListen | ( | const SocketName & | endpoint,
|  | int | backlog = 5,
|  | bool | reuse_address = true )

Create a listening socket for the specified end point.

## ◆ ~TCPListen()

clan::TCPListen::~TCPListen | ( |  | ) |

## Member Function Documentation

## ◆ accept()

TCPConnection clan::TCPListen::accept | ( | SocketName & | end_point | ) |

Accept an incoming connection.

Parameters

  end_point | Socket name of the accepted peer

Returns
  A TcpConnection for the accepted connection, or a null object if no incoming connections are available

## ◆ close()

void clan::TCPListen::close | ( |  | ) |

Stops listening for incoming messages and closes the socket.

## ◆ get_socket_handle()

SocketHandle * clan::TCPListen::get_socket_handle | ( |  | ) |
| overrideprotectedvirtual

Implements clan::NetworkEvent.

## ◆ is_null()

bool clan::TCPListen::is_null | ( |  | ) | const
| inline

Returns true if it is a null object.

The documentation for this class was generated from the following file:

- tcp_listen.h