1. It opens a socket to the mailserver with fsockopen
2. It checks the greeting by reading using fgets()
3. Then it check the reponse by supplying the username to the fsockopen() connection
4. It returns an empty string.
It seems as if the first time fgets() was used on the open connection, it reads it to EOF.
Any further attemps would fail because the data from the socket connection is at EOF.
I tried to rewind() it, but rewind() doens't take socket resource.
So, going by what this script is trying to do, (I have no experience with this), is it correct to assume, that with each attempt to talk to the server,
a new connection must be made to read data from it??
If you want more info, feel free to ask...
Gerard Samuel wrote:
Im debugging a script that opens a connection to a pop3 server.
When I var dump the return of fsockopen() from the script Im debugging, I get -> resource(38) of type (socket)
I made up a dummy script to see what I would get and the return of fsockopen is -> resource(1) of type (socket)
My dummy script is able to to recieve a +OK from the pop3 server but the other file is getting an empty string.
Is there a difference between 1 and 38??
-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php