in reply to Re: Socket Questions
in thread Socket Questions

I think I might have pasted the wrong worksheet the last time, this one is the one I am using (edited original post with code tags too). I will try the strict and diag settings too. What happens is the socket connects and the response from the server is dumped to screen. I then input my response and although I can see the <STIND> appear on the remote servers log the response from the server never appears on the perl app, if you know what I mean.

Replies are listed 'Best First'.
Re^3: Socket Questions
by 7stud (Deacon) on Nov 07, 2010 at 22:31 UTC

    When you post sentences like this:

    That is, I can't seem to keep sending the receivign.

    ...you have more important things to worry about than learning perl sockets.

    However, when dealing with sockets you have to realize that the data you send over a socket can be broken up into many chunks, and you can't know ahead of time how many chunks there will be. As a result, the other side(e.g. the server) has to know when to stop waiting for chunks of data to arrive and that your transmission is complete. Should the server stop trying to receive data after receiving one chunk of data? What if your data got broken up into three chunks? Should the server stop trying to receive data after reading three chunks? What if your data got sent in only one chunk? Then the server will wait indefinitely for two other chunks to arrive

    Because you can't know how many chunks your message will get broken into, you have to send some kind of signal to the server that it has read the end of your message. Is the server waiting until it reads "GOOGLEPLEX" before considering the transmission complete? Or, maybe its "THE END"? Did you add either of those to the end of the data you sent to the server?

    I suggest that before you try to interact with a remote server that you write your own server program to interact with your client program. Then you will hopefully see the issues involved in trying to determine when the other side has finished transmitting data.

    In the event you consider that too much bother, you have to realize that in order to communicate with a remote server, you have to know what 'protocol' the server expects you to use. That is, among other things, you must know what character(s) the server expects you to use to signal the end of your message.