Home > Winsock Error > Winsock Error Handling Vb6

Winsock Error Handling Vb6

Can't I just use it as : [code]: With Winsock1(intNext): .Accept(requestID): .SendData("Hello from server"): End With: [/Code]Technically yes, it's one of those odd VB-isms. You are consuming the event handling thread by sending the data and event with the DoEvents you aren't truely releasing the thread and there are threads that the winsock needs to We appreciate your feedback. Reply With Quote 06-14-04,11:38 AM #2 Krieger View Profile View Forum Posts Member Join Date Jan 2002 Location North of Boston, MA Without looking at the full source I'd have http://pdctoday.com/winsock-error/winsock-error-232.php

I'm still bothered by that Winsock.Close in the server. The only thing remaining to be programmed is the code to send data. vb Code: Option ExplicitPrivate Sub cmdconnect_Click()Winsock.RemoteHost = txtIp.Text ' this is the Ip of the server 127.0.0.1 loops back to your own computerWinsock.RemotePort = 15151 ' this is the port it One tip I'll give you is to make your Winsock control a control array by setting it's Index = 0. http://www.vbforums.com/showthread.php?477668-RESOLVED-winsock-error-handler

sckAlreadyComplete 10037 The operation is completed. This workaround is illustrated in the following code snippet:

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim szData As String

On Error Resume Next
Winsock1.GetData szData
This will cause the server to listen for connections.

Just look at each one. sckUnsupported 40018 Unsupported variant type. Reply With Quote 06-22-04,09:56 AM #5 Krieger View Profile View Forum Posts Member Join Date Jan 2002 Location North of Boston, MA Chris_F, can you upload your code or pm It should be near the middle of the list, as the controls are listed in alphabetical order. 4.

sckAlreadyComplete 10037 The operation is completed. I could be mistaken, but that seems to be a likely culprit of the odd behavior.[size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size][code]$ select * from users where clue > 0no rows returned[/code] 0 · Share on Facebook Join Now For immediate help use Live now! The error is 10053 (Connection is aborted due to timeout or other failure) - this is what is returned on the server end.

So that needs to be fixed (adding option explicit found this one pretty easily. like maybe you are causing sckWouldBlock(10035), sckMsgTooBig(10040), or sckNoBufferSpace(10055). Constant Value Description sckClosed 0 Default. Language Reference Events E E Error Event (Winsock Control) Error Event (Winsock Control) Error Event (Winsock Control) EditProperty Event EditQuery Event EndRequest Event EnterCell Event EnterFocus Event Error Event (ADO Data

The client computer is in the process of connecting to the server computer. http://www.dreamincode.net/forums/topic/246251-winsock-error-40009/ For these your program has a bug that is fatal, or perhaps you have failed to validate user-supplied data (port number in valid range, etc.). You should be able to use the intrinsic VB controls and have a working knowledge of the basic elements of the VB language specification. Join them; it only takes a minute: Sign up Why does my winsock control not function correctly in vb6 within the context of a Form_QueryUnload?

I'm un-confused again. this content Computer Hope Forum Main pageFree helpTipsDictionaryForumLinksContact Welcome, Guest. On a final note, your code should be designed with the error checking in it from the start, not as an after thought. The command takes this form:      On [Local] Error {Resume Next|Goto

  1. How long do you think you'll be waiting?Im not Sen[red]d[/red]ing Sumbl[red]i[/red]minal m[red]e[/red]ssages 0 · Share on Facebook infidel Member Posts: 2,900 February 2005 : [b][red]This message was edited by eternities_end at
  2. When you invoke, or call, a method you must decide whether you will be expecting a value to be returned.
  3. Thank you.
  4. Some APIs have native support for these protocols, such as DirectPlay.
  5. Was This Post Helpful? 0 Back to top MultiQuote Quote + Reply ← Previous Topic VB6 Next Topic → Page 1 of 1 Related VB TopicsbetaVB6 Winsock Error [include?] -
  6. If you are interested in learning more about the Winsock control, check out the following websites: · http://www.developerfusion.com/show/78/ · http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/mswnsk98/dt_vbobjWinsockControl_C.asp Of course, you can always e-mail me your questions: [email protected] Register
  7. So what happens here is that your Winsock1 writes data, and then snaps the socket closed and doesn't free up threading resources until the state of the socket has reached closed.

Some things to know if you don't already: If there is an error connecting, the Winsock_Error() event will fire. Can't I just use it as [code] With Winsock1(intNext) .Accept(requestID) .SendData("Hello from server") End With[/Code]One more small doubt, I have read a few tutorials on winsock programing and all of them SERVER/CLIENT:          FORM:                      This program will use a form that looks similar to the following: The user will either click the Host or Connect button, at which point in time weblink If the other end closes the connection, the Winsock_Close() event will fire.

A few may be recoverable in a limited fashion. As with properties, there are both Public and Private methods. As of May 1, an ISP/EDU email is NO longer required to access the Classifieds.

Thanks 0 LVL 8 Overall: Level 8 Programming 5 Visual Basic Classic 1 Web Services 1 Message Expert Comment by:Volox2011-10-27 I'd totally test it out for you if I still

For more information or to gain access, visit Classified Access Rules Change thread. (100 quality posts and 30-day minimum membership are still required) Results 1 to 5 of 5 Thread: Visual sckNotInitialized(10093) for example should be rare in a program using the Winsock control. Today's Topics Dream.In.Code > Programming Help > VB6 Winsock error 40009 Page 1 of 1 New Topic/Question Reply 2 Replies - 2441 Views - Last Post: 09 September 2011 - 10:57 An example is the ability to programmatically talk to Excel.

On the other hand, if the server is also a player and your game experiences a difficulty the game will most likely end for all the players. It's situational. sckNetReset 10052 Connection has timed out when SO_KEEPALIVE is set. check over here Perhaps closing the socket is premature, because maybe a winsock error does not always equal a disconnect.

At this point you can safely send and receive data. sckInvalidArgument 10014 The requested address is a broadcast address, but flag is not set. Finally, if for some reason you need to turn all error checking off you can do the following:      On Error Goto 0 The code tells the computer to not go Line 5 displays a message box so that the server knows that some one connected.                         NOTES: This program demonstrated the basic properties, methods and events in preparing a server application.

In the VB IDE, you access the Events in the right most ComboBox in the code window, of the specified control in the left most ComboBox.       This section My app was developed to accompany a specific online game - when clients experience these unexpected timeouts or other failures with my app, there is not a single network hiccup within They are a semi-complicated version of a variable, but contain many advantages. Members have access to different forum appearance options, and many more functions.

If you entered any code into the client application’s “wskClient_Connected” event, then you will receive notification from the client as well. More aggressive error checking should be applied in a full-blown application, however the IP address must be stored as string and the Port must be stored as a “Long”. You’ll be auto redirected in 1 second. If you choose not to have this option, then all procedures and functions will also have this error checking (unless, of course, they have their own error handling commands — but

The Winsock control offers the following methods, properties and events for sending and receiving data: - .BytesReceived (property) — Returns the number of bytes that have been retrieved through this connection I have to compare it to another project I did.