Winsock, connected??? Help!
I was wondering if you could help me on checking if the server is started or not.
so that I can make a offline/online function..
I have tried this:
Winsock1.Connect "192.168.46.12", "8866"
but don’t know what to do now, I don’t know if the connection is made or not.
How can I check that?
Re: Winsock, connected??? Help!
i dont remember how that works, although i have made that a while ago, anyways you can always search theses forums, there are always good answers here
Re: Winsock, connected??? Help!
check for the other winsock control's ConnectionRequest event, if that is triggered accept it from that end. then your connection is on.
Re: Winsock, connected??? Help!
yes, you can search for winsock in this forum. i remember somebody posted about this yesterday.
Re: Winsock, connected??? Help!
i have search, this forum, but cant seem to find anything about this.
i just need it to open a connection to a winsock server, check if it is online, if it is online then msgbox "Server is online!".
Something like that...
Re: Winsock, connected??? Help!
try searching planetsourcecode.... hope you find your answer...http://www.smileypad.com/v10/Cache/Feelings/Ask.gif
Re: Winsock, connected??? Help!
Re: Winsock, connected??? Help!
Use the UDPProtocol.. instead of TCP.. and send a small block of data to the server on any port..
Then all you need is a DataArrival sub on the Winsock.. If the Connection is accepted.. the Server will send a type of "What is this"reply.. or if the server is there but regects the connection.. you get a connection reset by Peer error that is trapable.. and usable to say well server is online...
hope this helps..
Gremmy..
Re: Winsock, connected??? Help!
What is the server? Is it a program you have wrote or a game server etc?
Re: Winsock, connected??? Help!
Quote:
Originally Posted by gnaver
I was wondering if you could help me on checking if the server is started or not.
so that I can make a offline/online function..
I have tried this:
Winsock1.Connect "192.168.46.12", "8866"
but don’t know what to do now, I don’t know if the connection is made or not.
How can I check that?
Always use TCP. It's more reliable.
Why not try using the Winsock_Connect() sub-procedure? It will execute if the connection is succesful.
If the server is down, the Winsock_Error( ) sub-procedure will execute. Try to find out what is error number when there is no server then use
VB Code:
If number = serverDownErrorNum then
' write what should be done if the server is down
end if
Re: Winsock, connected??? Help!
thanks bulletrick your method works perfect.. ;)
Re: Winsock, connected??? Help!
Quote:
Originally Posted by gnaver
thanks bulletrick your method works perfect.. ;)
Your welcome.
Re: Winsock, connected??? Help!
Please do not ask for reputation points its not allowed :)
Pino
Re: Winsock, connected??? Help!
Quote:
Originally Posted by Pino
Please do not ask for reputation points its not allowed :)
Pino
Hehe. I was right. Actually, it wasn't my idea. :D Sorry. :afrog: