Valhalla Legends Forums Archive | General Programming | Winsock Question

AuthorMessageTime
Crypticflare
I was looking around for it but couldn't find it on the botdev portion of the forum, I believe Mesiah explained the different numbers pertaining to winsock like

7=Connection
6=close

or somthing like that, I was wondering if anyone could repost them, I'm using VB6 if you need to know that.
February 10, 2003, 6:44 PM
kamakazie
If you hit F2 while in the IDE, there is a lot of information that can be gathered from there, such as the constants you are asking for.  Just change to the winsock library (MSWinsockLib), and click StateConstants and there you are.
February 10, 2003, 7:23 PM
Atom
basicly if the state isnt 7, you dont want to be sending stuff
February 16, 2003, 2:23 AM
Coltz
0 = closed
1 = open
2 = listening
3 = pending request
4 = resolving host name
5 = done resolving host name
6 = connecting to remote host
7 = connected to remote host
8 = closing connection to remote host
9 = error
February 16, 2003, 4:14 AM
haZe
Ohh so thats why some ppl use like

if sckbnet.state <> 7 then exit sub

ahh I see ok.
February 16, 2003, 8:59 AM
Crypticflare
Thanks everyone, answered my questions perfectly
February 16, 2003, 11:39 AM
Yoni
[quote]If you hit F2 while in the IDE, there is a lot of information that can be gathered from there, such as the constants you are asking for.  Just change to the winsock library (MSWinsockLib), and click StateConstants and there you are.[/quote]
Exactly. Why are you all using numbers? Use the symbolic constants!
February 16, 2003, 2:36 PM
MesiaH
lol ok my turn

[code]
VB Winsock Error Constants:

sckAddressInUse (0x02740) - Socket is bound or in use by another application.

sckAddressNotAvailable (0x02741) - Remote host cannot be reached.

sckAlreadyComplete (0x02735) - Current operation has already completed, can no longer do events on previous operation.

sckAlreadyConnected (0x02748) - Socket is already connected to remote host.

sckBadSate (0x09C46) - Socket is at an invalid state to perform current operation.

sckConnectAborted (0x02745) - Current connection has been aborted due to remote failure or timed out request.

sckConnectionRefused (0x0274D) - Current connection has been rejected by remote host.

sckConnectionReset (0x02746) - Current connection has been reset by remote host.

sckGetNotSupported (0x018A) - Can not receive data from remote host, socket is write-only.

sckHostNotFound (0x02AF9) - Could not resolve remote host. (Valid response)

sckHostNotFoundTryAgin (0x02AFA) - Could not resolve remote host. (Invalid response)

sckInProgress (0x02734) - Could not perform requested operation, previous one is still executing.

sckInvalidArg (0x09C4E) - A socket-specific function has received an invalid or out of range argument.

sckInvalidArgument (0x0271E) - Invalid argument.

sckInvalidOp (0x09C54) - Can not complete pending operation at the sockets current connection state.

sckInvalidPropertyValue (0x0H17C) - Invalid Property assigned to socket.

sckMsgTooBig (0x02738) - Data in current socket was too large, and truncated to prevent buffer-overflow.

sckNetReset (0x02744) - Connection timed out from SO_KEEPALIVE response.

sckNetworkSubsystemFailed (0x02742) - Remote Network Subsystem failed to give a response.

sckNetworkUnreachable (0x02743) - Host network is un-responsive.

sckNoBufferSpace (0x02747) - Cannot assign buffer-space to current socket.

sckNoData (0x02AFC) - No Data has been received from previous request to host.

sckNonRecoverableError (0x02AFB) - Socket has received a non recoverable error.

sckNotConnected (0x02749) - Socket is not yet connection to perform current operation.

sckNotInitialized (0x0276D) - Socket has not been loaded or initialized yet.

sckNotSocket (0x02736) - Object exists, but is not a valid socket.

sckOpCancelled (0x02714) - Current operation has been cancelled.

sckOutOfMemory (None, duh!) - Out of memory (:P)

sckOutOfRange (0x09C55) - Specified Argument is out of range.

sckPortNotSupported (0x0273B) - Port specified is not supported by socket.

sckSetNotSupported (0x017F) - Cannot send data to remote host, socket is read-only.

sckSocketShutdown (0x0274A) - Socket has been shut down or closed.

sckSuccess (0x09C51) - Socket's previous operation was successful.

sckTimedout (0x0274C) - Connection to remote host has timed out due to no response.

sckUnsupported (0x09C52) - Current procedure does not support specified variant data type.

sckWouldBlock (0x02733) - Socket is non-blocking, but will block current operation from execution.

sckWrongProtocol (0x09C5A) - Socket does not support protocol for current operation.
[/code]

[code]
VB Winsock State Constants:

sckClosed (0) - Socket is currently closed.

sckClosing (8) - Current connection to remote host is closing.

sckConnected (7) - Socket is now connected to remote host.

sckConnecting (6) - Current connection to remote host is in progress.

sckConnectionPending (3) - Socket is pending request from remote host.

sckError (9) - Socket has received an error. (All error constants listed above)

sckHostResolved (5) - Remote host name has been resolved.

sckListening (2) - Socket is now listening for connections.

sckOpen (1) - Socket is already open and awaiting deployment.

sckResolvingHost (4) - Socket is currently resolving remote host name.
[/code]

Cherish this forever!!!! Add to favorites, gogogo.
February 16, 2003, 7:41 PM
Noodlez
Just do what kamakazie said... all that stuff is in there mesiah
February 17, 2003, 1:54 AM
MesiaH
yeah but i took the time to explain them a little better, somebody who is new to winsock is gonna look at them explinations and be like uhhh ok???
February 17, 2003, 11:48 AM
kamakazie
[quote]yeah but i took the time to explain them a little better, somebody who is new to winsock is gonna look at them explinations and be like uhhh ok???[/quote]

As noodlez said, everything is in there.  It looks as if you just copied was the object browser says.  Example:

[quote]Const sckOpen = 1
   Member of MSWinsockLib.StateConstants
   Socket is currently open[/quote]

The same goes for the error constants.  The object browser is your friend, use it.
February 19, 2003, 12:14 AM
warz
"Winsock is better than BNLS"
February 22, 2003, 1:29 PM

Search