• Welcome to Valhalla Legends Archive.
 

Winsock Question

Started by Crypticflare, February 10, 2003, 12:44 PM

Previous topic - Next topic

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.

dxoigmn

#1
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.

Atom

#2
basicly if the state isnt 7, you dont want to be sending stuff
I am back! aINC is dead, ThinkTank PRO is alive.
VB, JAVA, ASM, C, its all yummy to me.

Coltz

#3
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

haZe

#4
Ohh so thats why some ppl use like

if sckbnet.state <> 7 then exit sub

ahh I see ok.

Crypticflare

#5
Thanks everyone, answered my questions perfectly

Yoni

#6
QuoteIf 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.
Exactly. Why are you all using numbers? Use the symbolic constants!

Mesiah / haiseM

#7
lol ok my turn

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.

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.

Cherish this forever!!!! Add to favorites, gogogo.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Noodlez

#8
Just do what kamakazie said... all that stuff is in there mesiah

Mesiah / haiseM

#9
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???
]HighBrow Innovations
Coming soon...

AIM Online Status: 

dxoigmn

Quoteyeah 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???

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

QuoteConst sckOpen = 1
    Member of MSWinsockLib.StateConstants
    Socket is currently open

The same goes for the error constants.  The object browser is your friend, use it.

warz

#11
"Winsock is better than BNLS"