in reply to Re^3: help me on socket programming
in thread help me on socket programming

hi...

I have tried run the command as below and its look hang.

>telnet 19.25.15.15 1998 Trying... Connected to 19.25.15.15. Escape character is '^]'.

I think this is the system scenario to do the data collection

1. Sent request to the remote server with specific address.

2. Remote server acknowledge with some info.

3. Collect available data based on the information and save into temporary file.

4. End connection

Replies are listed 'Best First'.
Re^5: help me on socket programming
by Utilitarian (Vicar) on Jul 12, 2013 at 11:23 UTC
    There does not appear to be a stream of data to read coming from that port when you connected, usually you have to send a request in these circumstances and the response is then sent and the socket is closed by the remote host or an agreed end of data signal flag is sent (usually "OK" or ("NO"|"KO")) to indicate the end of the data stream.

    In this case you should perhaps print your request to the socket and process the data stream until end of data or end of response token.

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."