On Jan 20, 2007, at 6:57 PM, Kevin Windham wrote:
So what are you doing if you don't use the close. Is the method
just completing and then the socket goes out of scope, or are you
using some other while-wend loop?
I personally would not typically use a socket how you are trying to
use it. I generally make the socket a property and then create a
subclass of the socket and fill out the events. Or, you could stick
one on a window and fill out the events that way. Using the events
makes it fairly straight forward. I think you can make it work how
you are trying to do it, but you will need to do looping and
polling and that would seem to be more challenging to get right.
I should have been more clear. My eventual aim is to connect to a
remote server, login, send a request, and get the response. I was
able to complete a transaction by hand using telnet, so I figured
it'd be straight-forward to do the same thing. I wrote a simple Java
app to stand in as the remote server for testing. All it does is
listen using readln and then print what it gets and respond. Again,
using telnet to talk to it works as expected.
My first try was to subclass TCPSocket. I would immediately see the
connect on my Java server, and I'd just spin in the RB app, waiting
for the connect, but the Connected event would never fire. Since my
needs are very simple I then figured I'd just do a synchronous
conversation, which is what the example in the language reference
happens to demonstrate right up until the part I need :-)
The flow I need is simply this:
connect
login
get confirmation
send request
get response
logoff
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>