alin19 Posted November 4, 2008 Share Posted November 4, 2008 i have a program that connects to a socket, worked fine until now, i'm geting this error, it is posible that isn't my program that creates this error? socket_write(): unable to write to socket [32]: Broken pipe Quote Link to comment https://forums.phpfreaks.com/topic/131336-socket-write-error/ Share on other sites More sharing options...
JonnoTheDev Posted November 4, 2008 Share Posted November 4, 2008 Have you successfully connected to the socket prior with socket_connect() Do you have an error routine if the connection fails i.e. if(!socket_connect(connection params)) { print "could not connect to socket"; exit(); } // continue processing - write to socket Quote Link to comment https://forums.phpfreaks.com/topic/131336-socket-write-error/#findComment-681984 Share on other sites More sharing options...
alin19 Posted November 4, 2008 Author Share Posted November 4, 2008 it works now, but i don't know from what that was, i was conecting to that socket, reading from it, but couldn't write now it works, thanks Quote Link to comment https://forums.phpfreaks.com/topic/131336-socket-write-error/#findComment-681989 Share on other sites More sharing options...
alin19 Posted November 4, 2008 Author Share Posted November 4, 2008 getting this error again i must restart my pc to stop geting this message, it's a fedora 7 Quote Link to comment https://forums.phpfreaks.com/topic/131336-socket-write-error/#findComment-682044 Share on other sites More sharing options...
aximbigfan Posted November 4, 2008 Share Posted November 4, 2008 Are you sure the socket is binding right? I had this problem. PHP sockets will stay open for a bit even after they are closed. Chris Quote Link to comment https://forums.phpfreaks.com/topic/131336-socket-write-error/#findComment-682049 Share on other sites More sharing options...
alin19 Posted November 4, 2008 Author Share Posted November 4, 2008 i'm using a pcntl_fork(), parent reading and child is writing, and i think that the child has remained open after i closed the parent, just twice has hapened, so there were was a child writing to that socket and the parent was disconected from the socket, so the socket was close, i think this was the problem i will be back after more tests Quote Link to comment https://forums.phpfreaks.com/topic/131336-socket-write-error/#findComment-682067 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.