socket_close() problem



Hi to everybody.

First, let mi apologize if I'm doing a newbe question: I'm not a PHP
programmer, but I have to solve a problem located in a PHP web page.
Thanks in advance if you try to help me.

I have a Linux host (Suse 9.2 2.6.8-24.14-smp) running
apache2-2.0.50-7.3 and php4-4.3.8-8.2. In this host there is also a C
custom made server. The PHP web page opens a socket in order to send
data to the C server. The problem happens when the web page close the
connection using socket_shutdown($socket,2); and socket_close($socket);
At this moment the socket connection ends (after a short TIME_WAIT
state), but the C server socket file descriptor remains until it is
stopped. There aren't error messages or values.

This is a lsof (list open files) screen showing the problem:

pcotcpvie 6509 mem REG 3,2 106308 8857
/lib/ld-2.3.3.so
pcotcpvie 6509 mem REG 3,2 1359489 8882
/lib/tls/libc.so.6
pcotcpvie 6509 0r CHR 1,3 28476 /dev/null
pcotcpvie 6509 1u CHR 136,1 3 /dev/pts/1
pcotcpvie 6509 2u CHR 136,1 3 /dev/pts/1
pcotcpvie 6509 3r FIFO 0,7 10100 pipe
pcotcpvie 6509 4w FIFO 0,7 10100 pipe
pcotcpvie 6509 5u unix 0xd0a01580 21433 socket
pcotcpvie 6509 6u IPv4 21434 TCP *:pcovie
(LISTEN)
pcotcpvie 6509 7u sock 0,4 21435 can't identify
protocol
pcotcpvie 6509 8u sock 0,4 21482 can't identify
protocol
pcotcpvie 6509 9u sock 0,4 21483 can't identify
protocol
pcotcpvie 6509 10u sock 0,4 22069 can't identify
protocol
pcotcpvie 6509 11u sock 0,4 22274 can't identify
protocol
pcotcpvie 6509 12u sock 0,4 22305 can't identify
protocol
pcotcpvie 6509 13u sock 0,4 22314 can't identify
protocol
pcotcpvie 6509 14u sock 0,4 22398 can't identify
protocol
pcotcpvie 6509 15u sock 0,4 22402 can't identify
protocol
pcotcpvie 6509 16u sock 0,4 22413 can't identify
protocol
pcotcpvie 6509 17u sock 0,4 22669 can't identify
protocol

At every new connection close, it appears a new "can't identify
protocol" line

This problem don't happen if I use a C client to connect to the C
server, so this let me to think that the problem is in the PHP code or
maybe in the apache config.

The fact is that I'm very disconcerted. I haven't found any information
on the net, so I will apreciate your suggests.

Kind regards!

.



Relevant Pages

  • Re: client socket to read individual messages
    ... connection where I am able to understand individual messages sent by ... defining a protocol, and message-length ... I recently had to devise a simple protocol of my own for a socket situation. ... and one classic solution for that problem is to write a little server ...
    (comp.lang.java.programmer)
  • Re: I want to write a network printer server...
    ... Then why not just make your printer a shared printer? ... server of your devising, so you can make it do anything you want. ... Open a socket, start sending data. ... you could use a protocol where you send the ...
    (microsoft.public.vc.mfc)
  • Re: client socket to read individual messages
    ... It's a common _and_ common-sense technique. ... defining a protocol, and message-length ... I recently had to devise a simple protocol of my own for a socket situation. ... and one classic solution for that problem is to write a little server ...
    (comp.lang.java.programmer)
  • Re: Letting a Python application phone home
    ... You need to define a protocol for the communication ... Look at the python module "socket" resp. ... "SocketServer" for low level tcp functions. ... let your program contact the server periodically. ...
    (comp.lang.python)
  • win32 socket, "Operation not supported"
    ... I have written an app which opens a TCP connection to a server and uses a protocol to communicate with it. ... available on a read socket, a full packet is read in a blocking fashion from the socket. ... The server side periodically sends updates on the state of the molecular dynamics engine. ...
    (comp.lang.python)