How To Repair Winsock Error 40006 Wrong Protocol Tutorial


Home > Winsock Error > Winsock Error 40006 Wrong Protocol

Winsock Error 40006 Wrong Protocol

Reply With Quote Quick Navigation Visual Basic 6.0 Programming Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Visual C++ & C++ Programming Visual C++ Programming current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. BUT, before some data comes back, the socket suddenly closes. I would recommend implementing multiple connections or reset the localport to 0 Winsock1.LocalPort = 0 0 LVL 29 Overall: Level 29 Visual Basic Classic 26 Programming Languages-Other 6 Message Expert have a peek at this web-site

The Connect event is a signal that the connect request has been accepted and the connection is established. I never use End. Reply With Quote August 19th, 2004,01:26 AM #7 HanneSThEGreaT View Profile View Forum Posts CG Bouncer Power Poster Join Date Jul 2001 Location Sunny South Africa Posts 11,224 Morning! Powered by vBulletin Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc.

But they are not before they are compiled into a setup exe. 0 LVL 29 Overall: Level 29 Visual Basic Classic 26 Programming Languages-Other 6 Message Expert Comment by:nffvrxqgrcfqvvc2005-09-28 You Reply With Quote Quick Navigation Visual Basic 6 and Earlier Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Visual Basic Visual Basic .NET VB.net CodeBank That's not a good programmingtechnique. Code Code: Win.SendData "block" Error Code: Run-Time Error 40006 - Wrong protocol or connection state for the requested tranaction or request.

  1. Run-time error '40006' : Wrong protocol or connection state for the requested transaction or request.
  2. Share a link to this question via email, Google+, Twitter, or Facebook.
  3. Unless you are using a UDP protocol, in which case both computers have to bind the connection.
  4. How this error occurs?
  5. Subscribe to our monthly newsletter for tech news and trends Membership How it Works Gigs Live Careers Plans and Pricing For Business Become an Expert Resource Center About Us Who We

Search Forums Show Threads Show Posts Advanced Search Find All Thanked Posts Go to Page... so the simplest way is to do what I mentioned above. 0 Message Author Comment by:John Account2005-09-27 Are there other properties that need setting? 0 LVL 29 Overall: Level I am getting runtime error 40006, i am guessing the connection is not properly established? thanx for the reply!

In Form_Declerations add this: Dim MyUpd As New eglThreadFTP.DownloadUpdates 0 LVL 29 Overall: Level 29 Visual Basic Classic 26 Programming Languages-Other 6 Message Expert Comment by:nffvrxqgrcfqvvc2005-09-28 Dim MyUpdates As New Positional Bathroom Etiquette Equal pay for equal work is controversial? JP Please remember to rate all postings. http://forums.codeguru.com/showthread.php?306753-Error-40006-wrong-protocol-or-connection-state Why does this happen?

i didnt even know ocforums had a programming section yeah as Krieger said.. MyUpdates.FTPConnect MyUpdates.FTPDownload End If End Sub Private Sub Form_Load() Set MyUpdates = New DownloadUpdates End Sub Private Sub Timer1_Timer() 'If isDownloadComplete Returns True then downloading is complete. 'Otherwise returns Home Bookstore/E-Books P2P Programmer Forums Wrox Blogs Connect with Wrox Code Resources International IT Certifications Navigation Register Now View Active Topics View Archives View Unanswered Topics Wrox Programmer Forums First Start NEW activeX EXE project 'Add 1 module.bas 'Class 1 is created by default Rename Project1 to: UDownloader Rename Class1 to: DownloadUpdates Rename Module1.bas to: FTP 0 LVL 29

something else is using port 1001, or b). http://www.overclockers.com/forums/showthread.php/304508-Visual-Basic-6-Winsock-Run-time-Error Is it possible that a). To start viewing messages, select the forum that you want to visit from the selection below. Well...so far so good.

Yes it's me again.... Check This Out Programming Languages-Other C++ Introduction to C++: Functions - Using Default Arguments Video by: Ian The viewer will learn how to user default arguments when defining functions. you need to just add a temp Public Variable to the ActiveX.exe so open it up and add this public variable to DownloadUpdates.cls Public rDownloadUpdates As String OK. Disconnecting..." Sock.Close: sock_close End If Error: MsgBox "An error has occured during data arrival.", vbCritical, "Data arrival error" End Sub It doesn't work!!

index 0): .Protocol = sckTCPProtocol What error are you getting? Is there? 0 LVL 29 Overall: Level 29 Visual Basic Classic 26 Programming Languages-Other 6 Message Expert Comment by:nffvrxqgrcfqvvc2005-09-26 <<< Run-time error '40006' From my experience that error means that I so how do i make it ask for the users permission to grant access for the required port? Source Register Help Remember Me?

First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone. I appreciate it very much. 0 LVL 29 Overall: Level 29 Visual Basic Classic 26 Programming Languages-Other 6 Message Expert Comment by:nffvrxqgrcfqvvc2005-09-27 Glad I could help, Hope it works out Thanx for alll the replies..

UpdateCheck = MyUpdates.ReadNewsFile("http://www.geocities.com/egl1044/news.txt") Caption = UpdateCheck 'If they match then download the file.

Then when the client does winsock.connect, it fires off the connection request in your server program. Why is this?Thanks 0 · Share on Facebook jeripedo Member Posts: 68 February 2005 Corrct me If i'm wrong but i believe your not supposed to use these prots because they I think if you use the UDP protocol, you could avoid needing two progams - although maybe I didn't read that properly. I so how do i make it ask for the users permission to grant access for the required port?

I have created a wrapper for you to use. Posting Permissions 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 What port are you trying to connect on? have a peek here Why? :( wd40bomber703-24-2008, 02:34 PMPost the code.

Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) If Number > I am almost finished, it will use all WinInet API's except for the news check it will use WinHTTP just to read the news.txt file, you can change it if you Well, it's working now...except for one small problem: Error message box popups with this message: UpdateWrapper has encountered a problem and needs to close. HTH JP Please remember to rate all postings.

Here is the receiver. Yes... They're both in my setup factory project coming from different directories but installing to the same directory. Better to use Call, though, IMO.: One more small doubt, I have read a few tutorials on winsock programing and all of them have one point in common and that is

Contact Us - Wrox - Privacy Statement - Top Powered by vBulletin Copyright ©2000 - 2016, Jelsoft Enterprises Ltd. 2013 John Wiley & Sons, Inc. Reply With Quote Quick Navigation Programming Tips and Tricks Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Overclockers.com Community News & Community Announcements Overclockers.com Article Login. Thanks.

Have you any code in the socket error event, and if so what is that telling you? Copyright Quinstreet Inc. 2002-2016 Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > Runtime error 40006: Wrong protocol or connection state for the requested transaction PDA Runtime Sign In Register Categories Recent Discussions Unanswered Best Of... something else is using port 1001, or b).

Last edited by aaronbromley; April 3rd, 2007 at 06:10 AM. After that, it sends a bunch of data, and my program expects some data to come back. Browse other questions tagged vb6 or ask your own question. w61 means Windows 7 or Windows Server 2008 R2.