Stream.NewData

wl

Well-Known Member
Licensed User
Longtime User
Hello,

I open a socket for reading asynchroneously:
Stream.Initialize (Socket1.InputStream, Socket1.OutputStream, "Stream")

Sub Stream_NewData(Buffer() As Byte) is then called when the server flushes its data (= OK)

But I want to keep the socket open and read the next data.

How do I accomplish this ?

The NewData is not called automatically for a second time and calling
Stream.Initialize (Socket1.InputStream, Socket1.OutputStream, "Stream") again results in a nullpointer exception.

Thanks !
 

wl

Well-Known Member
Licensed User
Longtime User
Thanks Erel.

I was in the impression that when new data was sent a new NewData event was called, but it seems it doesn't. So I will have to write a loop inside the NewData event ?

Thanks,

Wim
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Hi Erel,

That I need to check again; because it seemed it was not being triggered again.
 
Upvote 0
Top