Hi,
I have been searching a lot, but didn't find, a solution for a quite sticky problem. Since in VB.NET almost everything (e.g. Sockets) have become classes instead of *visual* objects with events, i cannot control data anymore in a socket. I'm posting this question here, because it might be useful for other classes too.
So, eventually the question:
In VB6, the socket, WinSock, was an object you could place on your form. When this socket was connected with a server, it could receive data, and when this happened, an event would be raised: DataReceived, with some arguments (size etc.). Since Socket in .NET has become a class, the events are gone, and i see no possibility of controlling a property, namely 'Available', which changes when data is received, and it contains the number of bytes available.
Is there any way to control a property (from which you do not have the source-code)? Should i use a different way to solve my problem? (My app doesn't follow a strict pattern in receiving and sending data)
If possible, I'd like not to use timers, they are very CPU intensive...
Thanks a lot for your help
I have been searching a lot, but didn't find, a solution for a quite sticky problem. Since in VB.NET almost everything (e.g. Sockets) have become classes instead of *visual* objects with events, i cannot control data anymore in a socket. I'm posting this question here, because it might be useful for other classes too.
So, eventually the question:
In VB6, the socket, WinSock, was an object you could place on your form. When this socket was connected with a server, it could receive data, and when this happened, an event would be raised: DataReceived, with some arguments (size etc.). Since Socket in .NET has become a class, the events are gone, and i see no possibility of controlling a property, namely 'Available', which changes when data is received, and it contains the number of bytes available.
Is there any way to control a property (from which you do not have the source-code)? Should i use a different way to solve my problem? (My app doesn't follow a strict pattern in receiving and sending data)
If possible, I'd like not to use timers, they are very CPU intensive...
Thanks a lot for your help