# Poco::Net

# class ICMPSocketImpl

Library: Net
Package: ICMP
Header: Poco/Net/ICMPSocketImpl.h

## Description

This class implements an ICMP socket.

## Inheritance

Direct Base Classes: RawSocketImpl

All Base Classes: RawSocketImpl, SocketImpl, Poco::RefCountedObject

## Member Summary

Member Functions: dataSize, receiveFrom, sendTo, timeout, ttl

Inherited Functions: acceptConnection, address, available, bind, bind6, close, connect, connectNB, duplicate, error, fcntl, getBlocking, getBroadcast, getKeepAlive, getLinger, getNoDelay, getOOBInline, getOption, getRawOption, getReceiveBufferSize, getReceiveTimeout, getReuseAddress, getReusePort, getSendBufferSize, getSendTimeout, init, init2, initSocket, initialized, ioctl, lastError, listen, peerAddress, poll, receiveBytes, receiveFrom, referenceCount, release, reset, secure, sendBytes, sendTo, sendUrgent, setBlocking, setBroadcast, setKeepAlive, setLinger, setNoDelay, setOOBInline, setOption, setRawOption, setReceiveBufferSize, setReceiveTimeout, setReuseAddress, setReusePort, setSendBufferSize, setSendTimeout, shutdown, shutdownReceive, shutdownSend, socketError, sockfd

## Constructors

### ICMPSocketImpl

ICMPSocketImpl(
IPAddress::Family family,
int dataSize,
int ttl,
int timeout
);

Creates an unconnected ICMP socket.

The socket will be created for the given address family.

## Destructor

### ~ICMPSocketImpl

~ICMPSocketImpl();

## Member Functions

### dataSize

int dataSize() const;

Returns the data size in bytes.

### receiveFrom

int receiveFrom(
void * param328,
int,
SocketAddress & address,
int flags = 0
);

Receives data from the socket. Stores the address of the sender in address.

Returns the time elapsed since the originating request was sent.

### sendTo

int sendTo(
const void * param327,
int,
const SocketAddress & address,
int flags = 0
);

Sends an ICMP request through the socket to the given address.

Returns the number of bytes sent.

### timeout

int timeout() const;

Returns the socket timeout value.

### ttl

int ttl() const;

Returns the Time-To-Live value.