Fast VB6 socket control-VBForums
Results 1 to 11 of 11

Thread: Fast VB6 socket control

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    15

    Fast VB6 socket control

    I've been looking to upgrade the socket on a project of mine for a while, as I have had complaints of lag from the current one. I don't want to use WinSock either, because it's not as powerful as I would like. What is a good, fast, powerful, and free socket that is supported by VB6?

  2. #2

    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...

  3. #3
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Candon City, Ilocos Sur, Phils.
    Posts
    10,810

    Re: Fast VB6 socket control

    You may want to try this.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,330

    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.

  5. #5
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    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.

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,330

    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.

  7. #7
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    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.

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,330

    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.

  9. #9
    New Member
    Join Date
    Apr 2010
    Posts
    2

    Re: Fast VB6 socket control

    Quote Originally Posted by dilettante View Post
    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 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.

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,330

    Re: Fast VB6 socket control

    Gosh, I didn't mean to ping Len, but I guess I did!

  11. #11
    New Member
    Join Date
    Apr 2010
    Posts
    2

    Re: Fast VB6 socket control

    Quote Originally Posted by dilettante View Post
    Gosh, I didn't mean to ping Len, but I guess I did!
    The wonders of google alerts...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.