in reply to Re: How to build a tcp session with a remote server?
in thread How to build a tcp session with a remote server?

There is no generic "hey, I can talk to any server" protocol.
Well, there is in the (still broad) scope of his question. In fact, the name of the protocol is even mentioned in the title of his question: tcp.
The protocol is server specific.
Only in the sense there in theory there exists "servers" that don't have a TCP/IP stack. I seriously doubt that connecting to such servers even crossed the mind of the OP.
  • Comment on Re^2: How to build a tcp session with a remote server?

Replies are listed 'Best First'.
Re^3: How to build a tcp session with a remote server?
by Marshall (Canon) on Aug 22, 2011 at 12:33 UTC
    Tcip/ip is a transport layer. It is a way for the client to shovel data bits into a pipe and for the server to read those bits. This lower level protocol ensures that the bits that I send is what you get.

    The next level higher is like: how many bits from you constitutes "one thing"? Maybe a fixed 256 bytes constitutes one "message". Maybe some string of characters which end in "\n" constitutes one "message". Maybe some number of lines that end in "\n" and a null line "\n" after all of the relevant lines constitutes collectively one "message". This is part of how the client "talks" to the server.

    This is client<->server message protocol specific. Perl is great at "\n" terminated messages! I print one line to you and then I receive one line back. Perl can also deal with fixed byte length message packets.

    Anyway all of this is related to the application I/F between client and server.

      Tcip/ip is a transport layer
      Assuming you mean TCP/IP here, you're wrong. Both TCP and IP are protocols (that's what the P in their names stand for). TCP is a protocol spoken on the transport layer (but there are more, of which UDP is probably the most well known). IP is another protocol, spoken on the internet layer (other protocols on said layer include ICMP, IGMP, and more).

      For the rest of your post, I've no idea what message you're trying to get across. But whatever it is, you're failing.

        No. I am completely correct.
        TCP/IP would correspond to layer 4, the transport layer of the OSI model. Just as I said.

        Transport means move bits from point A to B. Let's not get too whacked out on the number (layer 4 vs 5) because I think that number has changed over the years.

        What the OP wants to do is to talk to some server. He needs to be able to do more, a lot more than just "move bits" from A to B.

        What is required is to know what kind of messages are going to be sent. This is the how to interpret what I send and how to interpret what I receive as a client. Establishing a TCP/IP connection is just one step in the process - that's just the "get bits back and forth".

        Where I am failing here is that the whole idea of "talking to the server" means that there is an even higher level of protocol.

        Sorry that I'm not able to explain things better at the moment. Maybe some other Monks can help fill in the blanks.