nschessnerd 0 Posting Whiz in Training

Hey, I've been stuck on this for a long time now and ive tried various things...
i need to send multiple packets to a server for an infinite amount of time at an unknown rate, maybe 1 packet every 30 minutes, tor a few every 5 minutes... id like to do this from the same endpoint....
if i open a socket every time i send i eventually get time_wait.... if i set keepalive the server closes the connection after one packet [fin]... so what do i do?
currently i:
-to connect
create socket
set reuseaddr
set keepalive
bind
connect
-send
send
select
recv

if i try reconnection method i shutddown and closesocket
otherwise i loop through sending...

is this the right way? i have no experience with this at all... so can someone point me to example code (beej is not example code... just reference) or tell me the correct method?
thanks
m

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.