ValentinBELYN / icmplib

Easily forge ICMP packets and make your own ping and traceroute.
GNU Lesser General Public License v3.0
276 stars 45 forks source link

Use predefined socket either SOCK_DGRAM / SOCK_RAW on every invocation of ping API #76

Open tkekan opened 8 months ago

tkekan commented 8 months ago

There are use cases where this API is used by a service multiple times within a given minute. Wouldn't it be beneficial to have a predefined socket created and use the same socket for all send and/receive instead of creating a new socket on every invocation of the API i.e. avoid calling _create_socket on every invocation thus saving on socket lifecycle?

ValentinBELYN commented 5 months ago

Hi @tkekan,

Sorry for the delay. This is a good idea. I'll see how I can implement this.