Client-side socket read-response not firing?

Posted by Tim Kuehn on 10-Jul-2017 16:41

Now that I've got which socket is which all sorted out - I've got code that create a client, a server that waits for a connection, launches an endpoint object when a connection is made, receives data, and sends data - all in a nice event driven model. 

Problem is - READ-RESPONSE() is not working on the originating endpoint (ie the client side). GET-BYTES-AVAILABLE() show that there's data available, but nothing I've done have gotten the READ-RESPONSE trigger to work.

How is this supposed to be done? On the server side I set it when the CONNECT() event fires and that works fine. There's nothing nothing comparable on the client side so I've tried setting it right after the object's created, or after it's connected - to no avail. 

Posted by Tim Kuehn on 10-Jul-2017 17:32

Thanks for the suggestions - turns out I had a mismatched parameter call going on that was being masked by other activity and not showing up on the screen.

Posted by Tim Kuehn on 10-Jul-2017 18:18

Thanks for the suggestions - it turns out I had a mismatched parameter error that was being masked by other on-screen activity.

All Replies

Posted by jmls on 10-Jul-2017 16:51

I would hazard a guess that

A)  the read-response procedure (you are using that, right ? ) has gone out of scope or has been deleted

B) the client-side socket class has been cleaned up, and therefore is no longer connected.

C) the server-side "client" socket (not the server socket, the one you got when you were connected) was deleted

Posted by jmls on 10-Jul-2017 16:52

And, as suggested, have a look at the dot.r socket classes (stomp and socket) .

Oh - and Peter's suggestion: use the built-in classes in 11.xx

Posted by Tim Kuehn on 10-Jul-2017 17:32

Thanks for the suggestions - turns out I had a mismatched parameter call going on that was being masked by other activity and not showing up on the screen.

Posted by Tim Kuehn on 10-Jul-2017 18:18

Thanks for the suggestions - it turns out I had a mismatched parameter error that was being masked by other on-screen activity.

Posted by Peter Judge on 10-Jul-2017 18:28

If it make you feel any better, I shamelessly stole from Julian’s code (which , in turn, stole from Greg Higgins’s).
 
Be careful when mixing persistent .Ps and object wrappers – you can very easily get into a state where you hold circular references.
 
Also, in the client socket you can do the set-response-procedure before the :CONNECT(). The doc has detail on how to use it (interpret the various states). And you should use Greg’s chicken soup for sockets (see Julian’s and my code).

Posted by Tim Kuehn on 10-Jul-2017 18:42

Back in the day Greg used to brag that he and I were the only ones that could do sockets, which means I'm probably mixed in with your code "in spirit" one way or another. :)

The code includes PUB/SUB which means I'm doomed to the circular hell already. I've learned from Julian's experience and am determined not to repeat the experience. :)

This thread is closed