lexkymbeth Posted January 4, 2012 Author Share Posted January 4, 2012 I'm making a chat in vb6, it has name list, and chat, blah, blah… but i don't know how to kick people i was wondering how do i close win socket to a client?? its not in EO so i posted here. xD Link to comment Share on other sites More sharing options...
Ruins of Hell Posted January 4, 2012 Share Posted January 4, 2012 ```socket.close```Keep in mind: this closes the socket client side. The server has to send a message to the client that it needs to close. The server should also refuse messages from kicked people until theny reconnect.Also, I'm not sure if your chat is integrated into Origins or if it is a seperate entity. If it is integrated into Origins, you'll have to clean up Origins too. Link to comment Share on other sites More sharing options...
lexkymbeth Posted January 4, 2012 Author Share Posted January 4, 2012 @Soul:> ```> socket.close> > ```> Keep in mind: this closes the socket client side. The server has to send a message to the client that it needs to close. The server should also refuse messages from kicked people until theny reconnect.> > Also, I'm not sure if your chat is integrated into Origins or if it is a seperate entity. If it is integrated into Origins, you'll have to clean up Origins too.its not, thanks tho xD i thought no one would tell. so when i send a packet to the client```socket.close```will close just that client or them all…? Link to comment Share on other sites More sharing options...
Ruins of Hell Posted January 5, 2012 Share Posted January 5, 2012 @lexkymbeth:> its not, thanks tho xD i thought no one would tell. so when i send a packet to the client> ```> socket.close> ```will close just that client or them all…?Nope. You'll have to do two things:One, tell the client it has to go (send a packet to it, then have the client check if the packet content matches the close signal).Two, tell the server to ignore anything the client sends until it reconnects (otherwise, people could filter out the close signal). Link to comment Share on other sites More sharing options...
lexkymbeth Posted January 5, 2012 Author Share Posted January 5, 2012 ok thanks again! Link to comment Share on other sites More sharing options...
emblem Posted January 5, 2012 Share Posted January 5, 2012 Actually, if you close the socket on the server side the client side socket should raise an error saying it was closed.That's how TCP works. Link to comment Share on other sites More sharing options...
Ruins of Hell Posted January 6, 2012 Share Posted January 6, 2012 @Scootaloo:> Actually, if you close the socket on the server side the client side socket should raise an error saying it was closed.> > That's how TCP works.But nothing stops the user from reconnecting quickly. (I interpreted "kick" as ban them for like a minute or so, although in hindsight I'm not sure if that's what the OP wanted.) Link to comment Share on other sites More sharing options...
Godlord Posted January 6, 2012 Share Posted January 6, 2012 @Scootaloo:> Actually, if you close the socket on the server side the client side socket should raise an error saying it was closed.> > That's how TCP works."If the socket is connection oriented and the remote side has shut down the connection gracefully, and all data has been received, a recv will complete immediately with zero bytes received. If the connection has been reset, a recv will fail with the error WSAECONNRESET." - MSDN.i.e. unless you have to tell something important before closing the connection, you shouldn't bother being polite to your client, since TCP already is.@Soul:> But nothing stops the user from reconnecting quickly. (I interpreted "kick" as ban them for like a minute or so, although in hindsight I'm not sure if that's what the OP wanted.)Neither will what you just described. To do that you would have to store the IP-address in a list, with a timestamp in the future of when the entry becomes invalid, and simply refuse any connections that are made coming from that IP-address. Or, simply block account authentication through the same way.Yours faithfully, Stephan. Link to comment Share on other sites More sharing options...
lexkymbeth Posted January 9, 2012 Author Share Posted January 9, 2012 thanks, what Scootaloo said i was thinking of that, but souls right >.> im going to make a user system some time much easier to kick/ban Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now