Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^4: help me on socket programming

by bh_perl (Monk)
on Jul 12, 2013 at 09:24 UTC ( #1043919=note: print w/replies, xml ) Need Help??

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


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

>telnet 1998 Trying... Connected to 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."

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1043919]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2023-02-01 15:08 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (10 votes). Check out past polls.