hi all
i have been working on a program and about to give up.
i only have one problem to solve, or at least that is what i think anyways.
i need code with using pb tcp functions to
open a website, send a request and receive that request.
the request is already in a string from another source, so i do not not want to analyze the request, i just what to shoot the string to the web server and retrieve the results.
the problems with tcp routines comes when you are using an internet connection and when trying to get the last packet sent, there is a cost in time you pay. everything is fast enough up till then but when that packet size does not equal the you size in the tcp statement, your going to have to wait till the timeout value has been hit. that is the only thing that slows down an internet connection using pb tcp routines while retrieving data(packets) of unknown lengths, other that, while using tcp with known packet lengths or just knowing when the data being sent is done, one can make the program very fast, because you do not have to depend on the timeout feature.
i would suggest to anybody using tcp work and making use of pb tcp routines, that they send and receive all data in a preset size blocksize, and inside the packet, maybe the first byte could be a flag indicting whether it is the last packet send or not. it would be advised to also send how long the data is in that last packet too. come to think of it, it might be better to a packet with that information(the end of data has been reached and size the last data send), but there will be one more packet sent after that, where the receiving program can change the size of the packet being expected inside the tcp recv routine or the program sending can send that information on the first packet for the receiving program to read.
thanks paul
i have been working on a program and about to give up.
i only have one problem to solve, or at least that is what i think anyways.
i need code with using pb tcp functions to
open a website, send a request and receive that request.
the request is already in a string from another source, so i do not not want to analyze the request, i just what to shoot the string to the web server and retrieve the results.
the problems with tcp routines comes when you are using an internet connection and when trying to get the last packet sent, there is a cost in time you pay. everything is fast enough up till then but when that packet size does not equal the you size in the tcp statement, your going to have to wait till the timeout value has been hit. that is the only thing that slows down an internet connection using pb tcp routines while retrieving data(packets) of unknown lengths, other that, while using tcp with known packet lengths or just knowing when the data being sent is done, one can make the program very fast, because you do not have to depend on the timeout feature.
i would suggest to anybody using tcp work and making use of pb tcp routines, that they send and receive all data in a preset size blocksize, and inside the packet, maybe the first byte could be a flag indicting whether it is the last packet send or not. it would be advised to also send how long the data is in that last packet too. come to think of it, it might be better to a packet with that information(the end of data has been reached and size the last data send), but there will be one more packet sent after that, where the receiving program can change the size of the packet being expected inside the tcp recv routine or the program sending can send that information on the first packet for the receiving program to read.
thanks paul
Comment