"Noozer" <po********@127.0.0.1> wrote in message
news:O%****************@TK2MSFTNGP12.phx.gbl...
Hi!
Trying to get my head around working with network connectivity in VB.Net.
I've gotten a fairly decent control based on the sample in the
101VBSamples available from Microsoft.What I'm having problems with is the
GetStream.BeginRead method. Problem is that it's all one way... My
application connects and is able to send data, but I don't have much in
the way to provide realtime data back from my control
Is GetStrem.BeginRead method a line based method? i.e. Does it wait for
the CR/LF before it fires the delegate to read the buffer?
Is there a character based equivilent method? How about being able to fire
the delegate whenever there is any data at all in the buffer?
Basically, I want to watch the data stream for specific strings and fire
an event when they happen. I also want to have a realtime input buffer that
doesn't depends on a CR/LF to add data to the buffer.
Any help is appreciated!
It Sounds like you used the Winsock control a lot with older lanuages.. The
TCPClient Class works a whole lot differently in comparison. Have you
looked in the 101samples there should be a client Server chat program(If
there isn't let me know and I'll post some code for one). The TCPClient
class is all streams so your going to be directly working with Byte Arrays
to get anything from it, no more directly sending strings, no waiting for
CR/LF it just waits until the Buffer is filled or the other end has send all
its relevante data. There is also the Read method which will just read
bytes out of the buffer but it will sit there and hang your app if no data
is sent for awhile for Beginread is almost always your best choice.
If you're just wonder how the TCPClient works or want to see some samples
I'm sure we could find them for you. I've put quite a few things together
that uses that class.
Hope This helps some.