VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
Go Back  Xtreme Visual Basic Talk > > > VB6.0 Winsock - Going from WIN XP To WIN 7


Reply
 
Thread Tools Display Modes
  #1  
Old 11-01-2011, 12:37 PM
PEDerryberry PEDerryberry is offline
Newcomer
 
Join Date: Nov 2011
Posts: 4
Default VB6.0 Winsock - Going from WIN XP To WIN 7


I have a VB6.0 winsock app that works fine under WIN XP. When I install it on a WIN 7 machine, it will not open the 'second receive' pipe. I've disabled the Win 7 firewall, include the app in the firewall and all I get is a 425 error - cannot open connection. Any one encountered this before? Thanks.
Reply With Quote
  #2  
Old 11-02-2011, 04:21 AM
dilettante's Avatar
dilettanteVB6.0 Winsock - Going from WIN XP To WIN 7 dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,520
Default

In Windows the term "pipe" has a specific meaning unrelated to IP protocols.

Pwrhaps you can explain more about what you mean by "second receive pipe" telling us more about why it might be special? For example, you seem to suggest there is a "first" connection (I assume you mean that you're using TCP) that does work.

And where do you see the error? At the Win7 program or the other end?

This sounds like FTP.

Most likely what's going on is that the other end always uses the same Local Port number, your program uses the same Local Port number, and this connection is still in TIME-WAIT in your local TCP stack's tables from a prior use. Which end is initiating this second connection? I.e. if FTP are you using PASV mode or not?

If so, you need to choose a new local port at "this" (client) end before connecting. Set LocalPort to 0 prior to calling Connect to request a new ephemeral port.
Reply With Quote
  #3  
Old 11-02-2011, 06:55 AM
PEDerryberry PEDerryberry is offline
Newcomer
 
Join Date: Nov 2011
Posts: 4
Default

Better explanation -

A separate connection is established from the server back to the client for each transfer of data. This is commonly referred to as a "back connection". The "back connection" is being blocked and FTP 425 error is generated on the WIN 7 (Client) end. And it is FTP that is being run in passive mode, code as follows -

EC01_Winsock2.Bind 0, EC01_Address
EC01_Winsock2.Listen
EC01_Hex_Port = Hex$(EC01_Winsock2.LocalPort)
EC01_Sub = 1
While EC01_Sub > 0
EC01_Sub = InStr(EC01_Address, ".")
If EC01_Sub > 0 Then
Mid$(EC01_Address, EC01_Sub, 1) = ","
End If
Wend
If Len(EC01_Hex_Port) > 2 Then
EC01_Hex_Port = "0" + EC01_Hex_Port
ElseIf Len(EC01_Hex_Port) = 2 Then
EC01_Hex_Port = "0" + EC01_Hex_Port + "0"
Else
EC01_Hex_Port = "080"
End If
EC01_Control_Data = "PORT " _
& EC01_Address _
& "," _
& (Val("&h" + Left$(EC01_Hex_Port, 2))) _
& "," _
& (EC01_Winsock2.LocalPort And &HFF)
EC01_Winsock1_SendData EC01_Control_Data + vbCrLf

Is that a little better?

Last edited by PEDerryberry; 11-02-2011 at 12:08 PM.
Reply With Quote
  #4  
Old 11-09-2011, 01:45 PM
PEDerryberry PEDerryberry is offline
Newcomer
 
Join Date: Nov 2011
Posts: 4
Default

Bump - I guess no one else has ever encounted this problem?
Reply With Quote
  #5  
Old 01-11-2012, 09:19 AM
PEDerryberry PEDerryberry is offline
Newcomer
 
Join Date: Nov 2011
Posts: 4
Default

Well, thanks to fellow programmer who was also researching it with me, it was finally resolved -

The default dynamic port range for TCP/IP has changed in Windows Vista and in Windows Server 2008

To comply with Internet Assigned Numbers Authority (IANA) recommendations, Microsoft has increased the dynamic client port range for outgoing connections in Windows Vista and in Windows Server 2008. The new default start port is 49152, and the default end port is 65535. This is a change from the configuration of earlier versions of Windows that used a default port range of 1025 through 5000.
You can view the dynamic port range on a computer that is running Windows Vista or Windows Server 2008 computer by using the following netsh commands:
• netsh int ipv4 show dynamicport tcp
• netsh int ipv4 show dynamicport udp
• netsh int ipv6 show dynamicport tcp
• netsh int ipv6 show dynamicport udp
Reply With Quote
  #6  
Old 01-11-2012, 11:25 AM
dilettante's Avatar
dilettanteVB6.0 Winsock - Going from WIN XP To WIN 7 dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,520
Default

So it was FTP all along.

Hardcoding the emphemeral port range is always a bad idea. That's why you set the localport to 0: to request a free one be assigned.

Much much better though is to use PASV mode, where you open the data connection (no, it is not called "back connection") from client to server. Here the server will tell you via the control connection which port to connect to for the data connection. It also avoids the need for stateful firewalls that are protocol-aware and "know" about FTP's weirdness regarding standard mode operation.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7 VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
 
VB6.0 Winsock - Going from WIN XP To WIN 7
VB6.0 Winsock - Going from WIN XP To WIN 7
 
-->