Poco::Net

class ICMPSocket

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

Description

This class provides an interface to an ICMP client socket.

Inheritance

Direct Base Classes: Socket

All Base Classes: Socket

Member Summary

Member Functions: dataSize, mtu, operator =, packetSize, receiveFrom, sendTo, timeout, ttl

Inherited Functions: address, available, close, destroyBufVec, error, fromFileDescriptor, getBlocking, getError, getKeepAlive, getLinger, getNoDelay, getOOBInline, getOption, getReceiveBufferSize, getReceiveTimeout, getReuseAddress, getReusePort, getSendBufferSize, getSendTimeout, impl, init, isDatagram, isNull, isRaw, isStream, lastError, lastErrorDesc, makeBufVec, makeBuffer, operator !=, operator <, operator <=, operator =, operator ==, operator >, operator >=, peerAddress, poll, secure, select, setBlocking, setKeepAlive, setLinger, setNoDelay, setOOBInline, setOption, setReceiveBufferSize, setReceiveTimeout, setReuseAddress, setReusePort, setSendBufferSize, setSendTimeout, sockfd, supportsIPv4, supportsIPv6, type

Constructors

ICMPSocket

ICMPSocket(
    const Socket & socket
);

Creates the ICMPSocket with the SocketImpl from another socket. The SocketImpl must be a ICMPSocketImpl, otherwise an InvalidArgumentException will be thrown.

ICMPSocket

ICMPSocket(
    SocketAddress::Family family,
    int dataSize = 48,
    int ttl = 128,
    int timeout = 5000000
);

Creates an unconnected ICMP socket.

The socket will be created for the given address family.

ICMPSocket protected

ICMPSocket(
    SocketImpl * pImpl
);

Creates the Socket and attaches the given SocketImpl. The socket takes ownership of the SocketImpl.

The SocketImpl must be a ICMPSocketImpl, otherwise an InvalidArgumentException will be thrown.

Destructor

~ICMPSocket virtual

~ICMPSocket();

Destroys the ICMPSocket.

Member Functions

dataSize

int dataSize() const;

Returns the data size in bytes.

mtu static

static Poco::UInt16 mtu(
    const SocketAddress & address,
    Poco::UInt16 sz
);

Returns minimum payload path MTU size for the destination, or 0 if MTU can not be determined.

operator =

ICMPSocket & operator = (
    const Socket & socket
);

Assignment operator.

Releases the socket's SocketImpl and attaches the SocketImpl from the other socket and increments the reference count of the SocketImpl.

packetSize

int packetSize() const;

Returns the packet size in bytes.

receiveFrom

int receiveFrom(
    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 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.