Results 1 to 12 of 12

Thread: Just a notice about mswinsck

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Just a notice about mswinsck

    I am working with mswinsck 6.1.98.16, I don't know if there is a newer version.
    I also uses the VB5 engine.
    What I just discovered happens on XP and on win7.

    This is just a note about a misbehaviour..

    I was looking for a bug in one of my apps, it has a control remote console.

    Basically, it opens a socket, set listen mode, then it gets the connection, and start receiving byte arrays (frames of a video), and then it renders the video on the window.

    The receiver app by protocol, reads the .LocalIP plus localport property from the socket all the time, and comunicate it by another separate communication channel, as a way to say "hey, I am here, so the remote PC don't ping time out the subscription that is identified by the PORT+IP".

    and the video sender code at remote PC takes notes and resets the countdown for the ping time out.

    The problem is, that the sockets start reading a corrupted IP from the property .LocalIP, it removes just one character.

    If the IP is, 10.1.1.200, after a while it start reading 10.1.1.20 from the .LocalIP property. INCREDIBLE but confirmed.

    I changed the code to read the localIP only at the beginning, and then using a string backup variable to send the information by protocol. And it fixed. But was incredible, because I already looked at the code , that .LocalIP was NEVER assigned by my vb code.



    maybe is a newer version that fix the problem. Is one?
    Last edited by flyguille; Mar 13th, 2014 at 09:03 AM.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Just a notice about mswinsck

    6.1.97.82 is the version of the OCX on my system dated 2004

    I've never saw an issue and have been using it for over 10 years now [obviously it was a different version during part fo that time]

    Of course I have been using VB6 for over 10 years also. I did do a bit with Winsock in VB5 but not a lot really.

    The MSWSock.Dll is Version 5.1.2600.5512 dated 2008

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: Just a notice about mswinsck

    Quote Originally Posted by DataMiser View Post
    6.1.97.82 is the version of the OCX on my system dated 2004

    I've never saw an issue and have been using it for over 10 years now [obviously it was a different version during part fo that time]

    Of course I have been using VB6 for over 10 years also. I did do a bit with Winsock in VB5 but not a lot really.

    The MSWSock.Dll is Version 5.1.2600.5512 dated 2008
    I noticed the problem only because my code uses the LocalIP property AFTER making and using the connection. And I abuse of that property thinking that it will be stable.

    But, just do what everybody does, create the socket, reads the localIP and save it in a string variable if you needs a later use, that will never fail. And using a string is more efficient that reading an object property.

    But well, two years ago I did that in a timer, it reads socket.localport, socket.localIP and sends it as a AKN message to the controlled PC.

    I never suspected that the reading of the localIP will change over time, the localport is ok, is stable, but localIP not.

    And I don't thinks it had to do with VB5, reading a property of a object is standard and never changed.

    Well, my code, received a lot of bytes arrays (video frames), taking in account possibles fragmentations, etc. So everything works ok.... and a while later the remote PC closes the video sesion because it did ping time out.

    So tired not finding anything, adds debugs on all the activity, and it reported that the console was AKN with a modified IP.

    ok, run the console with the IDE.... and there was, just in the sentence of VideoSocket.LocalIP was a nice yelow label with the value (when hoovering the mouse), it was reading a corrupted IP! 10.1.1.20 instead of 10.1.1.200, so WTH!

    changed the code to read once the localIP property and done!, the app works perfect.

    Is not that normal of having the needs of knowing the localip, but when by some invented protocol at higher layer requires that, better to read once the localIP property after creating the socket, and not re-read it every time needed. Well, maybe once every time it creates the socket for the session, that way it will be prepare by IF the wifi assigned IP changes by a network failure, you know.
    Last edited by flyguille; Mar 13th, 2014 at 10:47 AM.

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Just a notice about mswinsck

    This is actually a pretty old problem.

    As far as I know version 6.1.97.82 was the last reliable version of the Winsock control. Version 6.1.98.17 tests as "flawed" here and it was part of an "update" intended to fix the very same problem introduced in 6.1.98.16 and other 6.1.98.x versions.

    This was the ill-fated "security rollup" that started back in December 2008 and was re-released about 4 times through about May 2010. They have never gotten it right!


    We talked about this at great length here in at least two lengthy threads that I can recall. Worse yet the bugs (consisting of numerous "off by one" errors in coding) are not confined to just the Winsock control. Many other VB6 controls are impacted, often with fatal outcomes. The ListView and other controls with complex object models have bugs here-and-there in collection index handling that make the controls unusable... or usable until suddenly they aren't (the bugs do not impact every collection's index processing).

    The good news is this only impacts directly developers who have inflicted the problem upon themselves. These "security rolloup" packages never got pushed through Windows update, so have to download and install the broken "updates" yourself!

    The bad news is that such self-infected developers often deploy applications containing these "diseased bees. Once they have victimized a user's PC your own clean applications may now fail when installed there as well.

    The truly "sad trombone" news is that these security rollups were designed so that they cannot be safely uninstalled. Once you have trashed your development systems in this way the only recommended fix from Microsoft is... reformat your hard drive, reinstall Windows and all of your software from scratch!


    So what does this mean for developers in practice?

    Well for one thing be extremely cautious about any VB6 controls "update" from Microsoft. Before installing it you have to download and unpack the update, and then test each OCX against your own test suite of programs to make sure these OCXs don't have the same bugs as the infamous security rollups. You have to do this in a VM, or at best by using isolated assembly manifests.

    For another it means that any VB6 applications you release in the wild (i.e. to customers and other end users) need to use isolated assembly manifests for private known-working versions of any of the OCXs that you supply with your applications. You can never install in the normal locations anymore (System32, etc.) or use the registry for component registration on target systems.

    What does it mean for Mort, and even Elvis? Well, those Morts are unaware of any of this, have no idea how to test without breaking their development PC, and wouldn't know an isolated assembly if it bit them. Morts are basically screwed. Most Elvi are no better off.
    Last edited by dilettante; Mar 13th, 2014 at 12:26 PM.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: Just a notice about mswinsck

    before using 6.1.98.16, I was using the one version that comes with XP SP2, or the one that comes with the VB5.

    I had problems like:

    Connections that goes to silence without triggering events and without any reason. Really, it didn't resists some more than X connection driving data at a time.
    On multiple connection requests, the RequestsID sometime don't match the INDEX given to the connection request funtion. (when handling a pool of sockets). So the connections gets CROSSED! :P, or worst one socket try to handle both connection and the other sockets gets none.

    Then, I changed to use cSocketMaster, after fixing some bugs on the class by using vb5 (not vb6), But this last one is not so fast as a c++ compiled component. It solves all the problems, but lose performance, and forget about video realtime transmission with that class. It is usefull only for low volume of data transmission.

    so like 2 yeas ago, I updated to the v6.1.98.16 and remove the cSockets, on that time it was the last version as found in the microsoft FTP or some resource like that.

    Again, It solve all that unstabilities compared by the earlier versions, but then, this module failed with not aparent reason, I didn't know the reason until today that I investigate and fix that with the mentioned workaround.

    If there is a new version of the socket, I want to know the DL url.
    Last edited by flyguille; Mar 13th, 2014 at 02:11 PM.

  6. #6
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Just a notice about mswinsck

    Like I said I have not encountered any issues with the version on my system and have been using it for a very long time as part of a commercial program I distribute. It is in use in over 100 different systems without any issues. I would guess that version was included in SP5 for VB6

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Just a notice about mswinsck

    In general when packaging a VB6 program for redistribution to and installation on other machines you want to create a Windows Installer package that uses the VB6 libraries merge modules that Microsoft provides. These help you avoid a host of evils.

    The mswinsck.msm provided contains the 6.1.97.82 version of this OCX from 2004. This is the VB6 SP6 version, and is the one you want to use. Earlier SP5 versions had a few bugs, and versions prior to that had even more.

    This is also the version you should package when creating reg-free COM isolated assemblies, unless you have a good reason not to (i.e. if Microsoft ever releases a newer one that doesn't have those new off-by-one-error bugs).


    Then, I changed to use cSocketMaster, after fixing some bugs on the class by using vb5 (not vb6), But this last one is not so fast as a c++ compiled component. It solves all the problems, but lose performance, and forget about video realtime transmission with that class. It is usefull only for low volume of data transmission.
    All I'll say about that beast is that performance is the least of its woes.


    VB5 support ended completely as of 2002 as far as I can tell. There was never any "extended support" so when its 5 years were up it was toast.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: Just a notice about mswinsck

    Do you thinks that there is a performance increase vb5 engine vs vb6? that is the only one reasong that maybe motivates me to change my VB IDE version in my old dev machine. Otherway, I will not bother. Because I am already developing in win7 & C# in other develop machine. Is not that I am stuck in VB, but I stil devs project & commercial apps that as are old, are all in VB and don't finds any motivation for moving it.

  9. #9
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Just a notice about mswinsck

    I have not noticed any performance increase between 5 and 6 but there are additional options in 6 and better support on XP and later systems

    We did have one complex piece of software that was written in VB5 and had some issues under Win2k and Xp but then I rebuilt it with VB6 and the issues were gone so make of that what you will.

  10. #10
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: Just a notice about mswinsck

    Quote Originally Posted by flyguille View Post
    If there is a new version of the socket, I want to know the DL url.
    Not MS-Winsock.ocx-compatible, but performance-optimized and used here "in production"
    (e.g. for fast realtime-transfers of MJPG-encoded Video-Streams - up to 12 PAL-Streams of
    720x576 resolution per Frame in parallel - in some customer-setups).

    As said, the interface and usage of the Events is a bit differing from the Winsock-OCX,
    ByteArrays the only supported "format"... It's contained in vbRichClient5.dll, if you want
    to make an attempt with those cTCPServer and cTCPClient-Classes.

    Regfree-support (not only) for this COM-Dll is directly available per DirectCOM.dll,
    which is part of this Mini--Framework: http://vbrichclient.com/#/en/Downloads.htm

    So this would not need any manifest-fiddling and work regfree down to Win98.

    Olaf

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: Just a notice about mswinsck

    Quote Originally Posted by DataMiser View Post
    I have not noticed any performance increase between 5 and 6 but there are additional options in 6 and better support on XP and later systems

    We did have one complex piece of software that was written in VB5 and had some issues under Win2k and Xp but then I rebuilt it with VB6 and the issues were gone so make of that what you will.
    Probably I will not bother, VB6 is finished as well as VB5, and from a point of view of practical use is the same, except when importing some code and it uses SPLIT() everywhere. Like when the original programmer was fanatic of splitting IP number by its DOTs and then recreating a DWORD just spitting it using a byte array.... odd way to handle IP numbering into a DWORD. for what the hell... anyway that, and the passing of arrays in functions as return.

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: Just a notice about mswinsck

    Quote Originally Posted by Schmidt View Post
    Not MS-Winsock.ocx-compatible, but performance-optimized and used here "in production"
    (e.g. for fast realtime-transfers of MJPG-encoded Video-Streams - up to 12 PAL-Streams of
    720x576 resolution per Frame in parallel - in some customer-setups).

    As said, the interface and usage of the Events is a bit differing from the Winsock-OCX,
    ByteArrays the only supported "format"... It's contained in vbRichClient5.dll, if you want
    to make an attempt with those cTCPServer and cTCPClient-Classes.

    Regfree-support (not only) for this COM-Dll is directly available per DirectCOM.dll,
    which is part of this Mini--Framework: http://vbrichclient.com/#/en/Downloads.htm

    So this would not need any manifest-fiddling and work regfree down to Win98.

    Olaf
    thanks but not, native fast VB code + gdi lib calls works great now. And it is already done. Don't want to add more things to the TO DO list.

Posting Permissions

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



Click Here to Expand Forum to Full Width