Search Webmaster Help and Solution

php-java socket problem

Hi,

I have a java server running and listening for socket connections. My php script will send data to Java socekt and read acknowledgement from server. The problem is php script seems to timeout when it tries to read data back from the connection. If I send data and never read back, it wont timeout. I am using windows server and client and I use fsockopen,fread,fputs functions for php. I even try using fputs with data length to make sure that it knows how much to send,but no success. According to my java output, it can read data immediately, but it even does not execute system.out which is just before call to socket write function. Is that Java problem or php problem? Please help me if you can. Thank you. Hi,

I have a java server running and listening for socket connections. My php script will send data to Java socekt and read acknowledgement from server. The problem is php script seems to timeout when it tries to read data back from the connection. If I send data and never read back, it wont timeout. I am using windows server and client and I use fsockopen,fread,fputs functions for php. I even try using fputs with data length to make sure that it knows how much to send,but no success. According to my java output, it can read data immediately, but it even does not execute system.out which is just before call to socket write function. Is that Java problem or php problem? Please help me if you can. Thank you.

View Complete Thread with Replies

Related Items

Query failed: connection to localhost:3354 failed (errno=111, msg=Connection refused).