By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,831 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,831 IT Pros & Developers. It's quick & easy.

email socket closing

code green
Expert 100+
P: 1,726
A class I use (phpmailer) succesfully opens a mail socket.
[PHP]fsockopen(,25,$errno,$errmsg, 10)[/PHP]
Expand|Select|Wrap|Line Numbers
  1. Succesfully connected to fsockopen with smtp_conn Resource id #18 
  2. host of the server 
  3. the port to use 25 
  4. error number if any 0 
  5. error message if any 
  6. return value 10 
immediately afterwards if I check the socket
[PHP]$sock_status = socket_get_status($this->smtp_conn);
print_r($sock_status);[/PHP]I get the following
Expand|Select|Wrap|Line Numbers
  1. sock_status Array ( [stream_type] => tcp_socket [mode] => r+ 
  2.     [unread_bytes] => 0 [seekable] => [timed_out] => [blocked] => 1 [eof] => 1 ) 
My question is does the 'EOF' and '0 unread bytes' mean the connection has closed
because the writer of the class thinks so.
The email has worked fine for two years but started to fail yesterday
because the 'EOF' is returning '1'
I have no idea what was being returned before because I have just used this class blindly with great success.
Anybody know what is happening?
Feb 14 '08 #1
Share this Question
Share on Google+
1 Reply

code green
Expert 100+
P: 1,726
After a heated discussion with our host provider the connection is no longer closing.

But while we are here can anybody explain how a socket can return 'EOF'
I know a socket and a file are basically the same, but where does 'eof' come from.
Feb 14 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.