Solved

Winsock: VB.NET slower than VB 6 ?

Posted on 2004-09-29
6
430 Views
Last Modified: 2010-05-18
Hello thanks for reading my post

I wrote a program utilizing Winsock in VB 6 a while back.  I recently got VB.net and am rewriting the program (not using the conversion tool; I'm doing it line by line).

I would think the VB.net program SHOULD be running faster...  a) its a newer version of VB & b) ive made several code improvements.  However, the client program (written in VB 6 still) takes a MUCH longer time to process incoming Winsock information than it did with the VB 6 version.

Has anything like this happened to anyone else?  Is it a compatibility issue perhaps?  Anything I can do to fix it?

Thanks for any advice you can give me!

Michael
0
Comment
Question by:michaelman
  • 3
  • 3
6 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12200355
How are you accessing Winsock?  Is is through COM interoperability?  Do you have "chatty" calls?  

COM Interoperability adds considerable overhead to your solution (if you that's what you are using).

Bob
0
 

Author Comment

by:michaelman
ID: 12202842
Thanks for the response.

I actually had trouble setting up the Winsock myself...      I found it was not like VB 6 where I could just drag a Winsock icon onto the form.  To get around this problem, I created a project containing just the Winsock control and used the conversion tool.

Can you explain what you mean by "chatty" calls?

Also, thanks for the tip on the overhead.  I recently discovered an article about alternatives to Winsock.  Havn't really had time to look at it in depth though.

Michael
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 50 total points
ID: 12202872
A "chatty" call, through Interoperability, is where you set a lot of properties one at a time, instead of all at once.  It depends on the implementation of the library, and how you access it.  The is overhead to making COM calls, so you want to keep them to a minimum (or chunking).

What are you trying to accomplish with Winsock?  It might be easily done with System.Net.

Bob
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:michaelman
ID: 12205118
Its pretty much an online game.  The client connects to the server, and the server uses winsock to send it commands like:  display this image at this coordinate...   display this text...  I try very hard to accomplish as much as I can with as little data transfer as possible.

Also, system.net was the topic of the article I mentioned in my previous post.  It would be great if you could comment on it.

Thanks

Michael
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12219521
Would you like to find alternatives from System.Net and sockets?  It is possible.

Bob
0
 

Author Comment

by:michaelman
ID: 12219609
Yeah, I'll go ahead and start looking on the net.

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question