Advanced Search VBForums Visual Basic Visual Basic 6 and Earlier Winsock error 40006 [resolved] If this is your first visit, be sure to check out the FAQ by clicking the link JP Please remember to rate all postings. check the winsock state befure u try to connect 0 LVL 29 Overall: Level 29 Visual Basic Classic 26 Programming Languages-Other 6 Message Expert Comment by:nffvrxqgrcfqvvc2005-09-27 'I dug up an However I have tried sending the API to the machine where the server program is hosted, via a string, then allowing the server to receive the incoming data and calling the navigate here
That would certainly cause a 40006 because you would be trying to send before the connection is established. Here's a compiled version of the standard.exe and activex.exe. First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone. You aren't by any chance typing something into txtSend and then clicking cmdConnect are you? https://social.msdn.microsoft.com/Forums/en-US/16eae296-d621-4761-87f2-9b72cc39fcc3/winsock-error-code-40006-and-40020?forum=vblanguage
Friday, August 10, 2007 7:51 PM Answers 0 Sign in to vote Please use this thread to get help with Visual Basic 6 problems http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=478161&SiteID=1 This forum is for VB.NET Really appreciate the help! HanneSThEGreaT, I'm curious about one thing. I think I followed your instructions to a T, but there's obviously something I'm missing.
JP Please remember to rate all postings. Something like: '==================================== if winsock.state=9 ' error state winsock.close while winsock.state<>0 ' closed state doEvents wend ' you need a while loop, because it doesn't close Please check the email address on record for this account for a notification from Lunarpages. Your code seems very similar to mine, the only thing I do different is in the client connection event, send a message to the server (this was something someone suggested when
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 I think if you use the UDP protocol, you could avoid needing two progams - although maybe I didn't read that properly. VB.NET MVP 2008 - Present Reply With Quote Aug 19th, 2004,10:40 AM #6 ccoder View Profile View Forum Posts Visit Homepage Frenzied Member Join Date Aug 2000 Location O! Join the community of 500,000 technology professionals and ask your questions.
Over the last 10 years we have paid out approximately 5 million dollars in commissions! Forum New Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts View Site Leaders What's New? Sign In Register Categories Recent Discussions Unanswered Best Of... I have to connect to the server (if I remember correctly, that was my original intention, because I created a server form) Now, from the client to the server - it
Originally Posted by jp140768 Do you need to have the following property set for the inital socket (i.e. http://www.overclockers.com/forums/showthread.php/304508-Visual-Basic-6-Winsock-Run-time-Error Nothing wrong in sending just one request to that client.2 Winsocks, not indexed - vb6Code:Code:'SEND TO FIRSTWith frmWinsocks.Winsock5.Connect 126.96.36.199, 1007.SendData "data"DoEventsCall frmWinsocks.SafeCloseAfter 'CLOSES CONNECTIONDoEventsEnd With'SEND TO 2NDWith frmWinsocks.Winsock6.Connect 188.8.131.52, 1008DoEvents.SendData "data Well...so far so good. Password Reminder Password Register Register | FAQ | Members List | Calendar | Today's Posts | Search Beginning VB 6 For coders who are new to Visual Basic, working in VB
Asynchronous download VB.NET vs C# VB.NET vs C# Reply With Quote Aug 18th, 2004,02:19 PM #3 ccoder View Profile View Forum Posts Visit Homepage Frenzied Member Join Date Aug 2000 Location check over here end if ' now you reopen it, or do whatever else you need '==================================== Also, try downloading SP3 (the winsock control in the newest/latest Microsoft VB). Something like: Code: Private Sub Ticker_Timer() ' Display the socket state ' This updates the panel text every half second Dim sState As String Select Case tcpClient.State Case sckClosed sState = Here is the receiver.
Categories 141.9K All Categories104.9K Programming Languages 6.4K Assembler Developer 1.9K Basic 39.9K C and C++ 4.3K C# 7.9K Delphi and Kylix 4 Haskell 9.6K Java 4.1K Pascal 1.3K Perl 2K PHP However, there is one program I continually find myself reverting back to…R. So … R Programming Programming Languages-Other Scripting Languages VBS script to start Windows Updates installation Article by: Hector2016 TCP or UDP? 0 LVL 9 Overall: Level 9 Visual Basic Classic 7 Programming Languages-Other 1 Message Active today Expert Comment by:Naveen Swamy2005-09-27 http://www.vbip.com/forum/topic.asp?id=5646 http://www.xtremevbtalk.com/archive/index.php/t-231766.html 0 LVL 17 Overall: his comment is here Registration is fast, simple and absolutely free .
Or is there a better way of doing thisThanks 0 · Share on Facebook Comments HackmanC Member Posts: 441 February 2005 If you call the SendData method in the WinSock control 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 another thing that stuffed me around was the Tabindex Property So I ended up making the connect button's TabIndex 0 Thanks for all your help!
GET STARTED Join & Write a Comment Already a member? Jmacp, That depends on whether you are referring to the client or the server. Any other ideas? Reply With Quote August 18th, 2004,12:08 PM #5 cjard View Profile View Forum Posts Elite Member Power Poster Join Date Oct 2003 Location .NET2.0 / VS2005 Developer Posts 7,104 would that
However i get the following error: Run-time error '40006' Wrong protocol or connection state for the requested transaction or request. Client Code: Option Explicit Private Sub cmdAction_Click() Actions.Visible = True End Sub Private Sub cmdClose_Click() wsRat.Close cmdClose.Enabled = False cmdConnect.Enabled = True End Sub Private Sub cmdConnect_Click() If txtIP.Text = "" It then sends a brief message to the client so the client knows the server is ready. : What does the "call" do? weblink You sure do know your stuff! 0 LVL 29 Overall: Level 29 Visual Basic Classic 26 Programming Languages-Other 6 Message Expert Comment by:nffvrxqgrcfqvvc2005-10-02 Hi, JohnLucio, You might want to consider