Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: help me on socket programming

by NetWallah (Canon)
on Jul 12, 2013 at 05:14 UTC ( [id://1043876]=note: print w/replies, xml ) Need Help??


in reply to help me on socket programming

Try using 'telnet' to connect to the socket, and see if it sends a prompt immediately on connection.

If it does not, your program may need to send data out to the server first.

             My goal ... to kill off the slow brain cells that are holding me back from synergizing my knowledge of vertically integrated mobile platforms in local cloud-based content management system datafication.

Replies are listed 'Best First'.
Re^2: help me on socket programming
by bh_perl (Monk) on Jul 12, 2013 at 07:05 UTC

    hi...

    I am able to ping and telnet to that IP. But why my socket programming did not display anything. Its suppose to display the received data.

    Please guide me

      To expand what NetWallh said, when you telnet to port 1998 with the command below, does it send a response, or do you need to send a request in order to get a response?

      telnet $SWITCH_ADDRESS 1998

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

        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

        hi...


        Based on the trace packet, I found that my server using port 1998 and the remote server using port 61236.

        How could i write the socket program to connect from my port (1998) to remote system on port (61236).

        This is sample data trace:

        Sent request to remote system
        -------------------------------- TCP Header -------------------------- +-------- sport: 1998 --> dport: 61236 flags: PUSH ACK seq: 0xfd2fed0a urp: 0x0 chksum: 0xe16a data len: 519 ack: 0x2f975faf win: 0x1ed9 optlen: 0 -------------------------------- XOT --------------------------------- +--------

        Remote server acknowlegde
        -------------------------------- TCP Header -------------------------- +-------- sport: 61236 --> dport: 1998 flags: PUSH ACK seq: 0x2f975faf urp: 0x0 chksum: 0x1b data len: 7 ack: 0xfd2fef11 win: 0x8000 optlen: 0 -------------------------------- XOT --------------------------------- +-------- 0: 00 00 00 03 10 01 41 -- -- -- -- -- -- -- -- -- ......A........ +.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-24 22:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found