Re: Fast VB6 socket control
other than resorting to straight winapi, mswinsck i find is pretty good
are you sure its not a resource issue? each instance of that control takes up memory...
Re: Fast VB6 socket control
You may want to try this.
Re: Fast VB6 socket control
I would look elsewhere first if you are having performance problems, the Winsock control actually does fairly well. I have used it in several Windows Service projects to replace .Net applications that were too slow. Usually I get around 10 times the data throughput of the old .Net Service and in almost every case a 3 to 5 times improvement.
Almost all of the difference is in the quality of the code and architecture of the program.
That doesn't mean the Winsock control is without its limitations. I have had some server projects where I had to use a 3rd party "socket server" library in order to support large numbers of clients. But to do a lot better than with the Winsock control you have to go to I/O Completion Ports.
If you have less than 300 or so clients the Winsock control is usually fine.
One place people get into trouble is designing "chatty" protocols for things like file transfers. You do not want to use a scheme where you send a block of data and wait for the other end to send an acknowlegement, go ahead, send more sort of message. This will really degrade performance.
Re: Fast VB6 socket control
dee-u: unfortunatenaly UniSock, despite being coded quite powerful from the VB6 side, has problems with it's subclassing thunk and is crash prone. It needs an update to use the same subclassing thunk as CSocketMaster (which is known to be working), but I don't have the time & interest to do that. CSocketMaster's VB6 code is sloppy and inefficient.
I would say Winsock is the safe & good choice in most cases, just make sure you use it wisely as written by dilettante.
Re: Fast VB6 socket control
If you are convinced you need a better performing component than the Winsock control there are a number of options. Most of them don't make any sense in simple client programs though.
One that is free is A high performance TCP/IP socket server COM component for VB. You can find a newer version of this at Latest release of socket server code, which has the newest free version as far as I know.
The last time I looked seriously at that CSocket/CSocketMaster thing written in VB6 it was pretty warty. It had so many problems that you couldn't even use a socket object to connect more than one time. You had to destroy and create new sockets each time you needed to connect. There were also situations where it would lock up and not transfer data, but I never did isolate those. It might be better since then but it would take a lot to get me to even look at it again.
Re: Fast VB6 socket control
Yeah, I remember when implementing UniSock that I saw a number of oddities in CSocketMaster's code. I can't recall what they were in practical level, but I tried to fix what I could with UniSock. Unfortunatenaly I didn't choose a good subclassing thunk to use for Winsock use and noticed the problems only later on when I finally could do a few proper test runs. And ASM code is something I'm not familiar with that I could do changes or fixes.
Re: Fast VB6 socket control
It isn't something I found easy to do right myself. Using the Winsock API in a synchronous manner isn't too hard but I don't have much need for that. Those async calls can get a little tricky.
Re: Fast VB6 socket control
Quote:
Originally Posted by
dilettante
The code that I posted on codeproject back in 2002 still works pretty well but if you have problems with it please drop me an email or leave a comment on my blog. There are no open bugs with the COM object at this time.
Re: Fast VB6 socket control
Gosh, I didn't mean to ping Len, but I guess I did!
Re: Fast VB6 socket control
Quote:
Originally Posted by
dilettante
Gosh, I didn't mean to ping Len, but I guess I did!
:) The wonders of google alerts...