Solved

Winsock: VB.NET slower than VB 6 ?

Posted on 2004-09-29
6
426 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Multiple file Upload asp.net 2 40
Change Format on Data when exporting to Excel 4 23
Pagebreak issue while printing the aspx page 3 15
Variable Event ? 3 23
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now