in reply to Re^4: Problem with Socket Programming Perl Script
in thread Problem with Socket Programming Perl Script

You seem to have it backwards. nco_objserv is listening on that port (see "LISTEN" in netstat output).  That means it won't send any data unless you connect to it as a client. Which is what your first attempt looked like... So, modify that initial code to just don't do accept, but rather simply read from the socket.

Replies are listed 'Best First'.
Re^6: Problem with Socket Programming Perl Script
by ashok.g (Beadle) on Jan 24, 2011 at 11:24 UTC
    Also, I have
    tcp        0      0 192.168.0.34:4500           192.168.0.34:32996          ESTABLISHED 22948/nco_objserv Here, for the port 4500 I have both LISTEN and ESTABLISHED.Can't I retrieve data now?
      Can't I retrieve data now?

      Unlikely, PEBKAC related

      This just means that nco_objserv is having open ("ESTABLISHED") connections to other processes (nco_p_syslog and nco_p_mttrapd presumably, judging by your previous netstat output).

      As servers typically allow to have connections to multiple clients at the same time, you can likely still connect to it.

        What is PEBKAC?
        How should I proceed now?