Solved

Winsock: VB.NET slower than VB 6 ?

Posted on 2004-09-29
6
424 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Query datatable in LINQ 6 39
Help with uploading excel file 2 31
Vb.Net Menu 1 22
Form design in vb.net 7 18
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…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

19 Experts available now in Live!

Get 1:1 Help Now