linux, sockets, c



Hi,

I'm new to linix programming and I need some help. I'm writing a program
to collect data from remote devices using sockets.
My program:
-connects to remote device (sockets,TCP)
(5x){
-sends some data,
-receives some bytes
}
-decode data
-write to mysql database
-close connection

It takes ~20s. There are n devices (~50). I need to do every 5 min.
The ideal solutions is to read all devices at the same time. How to
impement that? Fork() ? Threads ? Select() or write one client and with
crontab run program ip1, program ip2.... ? Any suggestions, pointers,
help or links would be very helpful. Maybe it could be done like port
scanner?

Thanks a lot
Leo
.