-
Sockets.Net Vs Winsock
i am developing an application in vb.net that should use winsock, but .net doesn't have it.
So i tried to use "System.Net.Sockets" package, but it takes about 10 seconds to connect, using vb6 winsock, inside vb.net, it takes only 1 second.
Why? Shouldn't be faster the .Net package??
Thank you,
Guilherme Costa
-
I only have a couple of projects using sockets, but have not seen this problem. Things connect right away. Maybe post some code?
-
It must be related to your code specifically because I have used .NET sockets without any problem.
Mike's all about beating me to the punch today!:)
-
Edneeis which socket classes do you use?
-
Either the TCPClient or just the Socket class. Other than that I have a code sample from a book that helps get objects from a networkstream and I have tweaked it a lot so its more to my liking, I use that for some things too.
-
Hmm i was asking if you used some 3rd party(or made by yourself) wrapper classes
-
Nope no 3rd party stuff, just the Framework classes or things I've made myself (sometimes with the help of that book sample code). The framework classes are actually pretty good, once you get the hang of them. Although it was hard, for me at least, to change my way of thinking about sockets from the VB6 days. At first I wanted an exact replica of the Winsock control but now I prefer the .NET Socket style. I generally just serialize objects to xml and send them through the socket to be deserialized at the other end. That way I'm will dealing with objects and there is less parsing, the socket is just for transportation.
-