linux - Checking if UDP port is opened already in C -


lang: c

how can check if udp socket opened can increment used port , send on next socket, don't have idea how sockets server need. can't use port 0 have start @ specific port. solutions have right either implement own queue trace open ports or try read /proc/net/udp

is there defined api? if no, can submit sample code trace opened ports used program?

if port in use bind fail. if fails need increment port trying use. save when want use next port. bind returns -1 when fails. btw, using linux? can stablish max , min port number , when port want use reach max, set port equal min (this simplest method). other methods need shared memory or semaphores , locks.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -