Programming with sockets
Posted: Mon Sep 26, 2005 3:27 pm
I have a general socket question.
Here is what I am trying to accomplish.
I have a vb program that takes user input and stores it in a database. It then loops with a counter of 30 seconds or until it gets a response in the database with a status of 'C'.
The record in the database gets a status of 'C' from a php script that runs in the background of a Linux machine.
It's job is to look for data in the database send the data to a IP:PORT at another location. Then it updates the response from the IP:PORT back into the database.
I have 130 sites all sending data to the database.
I was wondering if it is possible to have 2 background cues.
1st queue would only look for data in the database and send requests to the IP:PORT
2nd queue would only receive data from the IP:PORT and enter the results back into the database.
I am currently doing it with one queue. And I use fsockopen, fputs, and fgets. I tried to break this up into 2 queues with one using fputs and the other using fgets, but I think you have to put and get on the same script.
I am allowed up to 8 connections on the IP:PORT. So I was hopping I would be able to send and receive with different scripts
Any suggestions
Thanks,
jmsloan
Here is what I am trying to accomplish.
I have a vb program that takes user input and stores it in a database. It then loops with a counter of 30 seconds or until it gets a response in the database with a status of 'C'.
The record in the database gets a status of 'C' from a php script that runs in the background of a Linux machine.
It's job is to look for data in the database send the data to a IP:PORT at another location. Then it updates the response from the IP:PORT back into the database.
I have 130 sites all sending data to the database.
I was wondering if it is possible to have 2 background cues.
1st queue would only look for data in the database and send requests to the IP:PORT
2nd queue would only receive data from the IP:PORT and enter the results back into the database.
I am currently doing it with one queue. And I use fsockopen, fputs, and fgets. I tried to break this up into 2 queues with one using fputs and the other using fgets, but I think you have to put and get on the same script.
I am allowed up to 8 connections on the IP:PORT. So I was hopping I would be able to send and receive with different scripts
Any suggestions
Thanks,
jmsloan