Raised This Month: $32 Target: $400
 8% 

[EXTENSION] Sockets (2.0.0)


Post New Thread Reply   
 
Thread Tools Display Modes
sskillz
Member
Join Date: Apr 2005
Old 05-06-2007 , 01:21   Re: [EXTENSION] Sockets
Reply With Quote #11

I have a plugin waiting just for this ^_^
good work!
sskillz is offline
Olly
Senior Member
Join Date: Mar 2007
Location: UK
Old 05-06-2007 , 21:29   Re: [EXTENSION] Sockets
Reply With Quote #12

Major update, see First Post

Olly is offline
Send a message via MSN to Olly
sskillz
Member
Join Date: Apr 2005
Old 05-09-2007 , 13:58   Re: [EXTENSION] Sockets
Reply With Quote #13

Good job!
Looks promising, I'll try as soon as my srcds will stop downloading

Just one thing I think is missing is this:
Code:
/**
 * Defines the callback function when a the specified socket closes
 *
 * @param    socket                The id (handle) of the socket to set the callback for.
 * @param    function            The function to use as callback.
 */
native SetSocketCloseCallback(socket, function);
And btw, now if the socket is not connected or gets disconnected, is the handle changes to undefined ? or not > 0 ?

Last edited by sskillz; 05-09-2007 at 14:00.
sskillz is offline
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 05-09-2007 , 16:20   Re: [EXTENSION] Sockets
Reply With Quote #14

Very nice.

I would like to see the connect function to be non-blocking with a callback for it though.. for it to be truly non-blocking. Also, like sskillz said, a callback for disconnection should exist, unless the error callback was meant to cover that.

Note: Should the Function: tag be used?


Edit: A good reference would be the asyncore module in Python.
__________________

Last edited by sslice; 05-09-2007 at 17:28. Reason: asyncore
sslice is offline
BAILOPAN
Join Date: Jan 2004
Old 05-09-2007 , 18:03   Re: [EXTENSION] Sockets
Reply With Quote #15

o_O yes definitely use the function tag, or even better, use functag.
__________________
egg
BAILOPAN is offline
sskillz
Member
Join Date: Apr 2005
Old 05-10-2007 , 09:58   Re: [EXTENSION] Sockets
Reply With Quote #16

Whats a function tag and how is diffrent from how it is now?

Last edited by sskillz; 05-10-2007 at 10:01.
sskillz is offline
BAILOPAN
Join Date: Jan 2004
Old 05-10-2007 , 12:39   Re: [EXTENSION] Sockets
Reply With Quote #17

It's like a data type. It prevents warnings from using incorrect types.

http://wiki.alliedmods.net/Tags_%28Scripting%29
__________________
egg
BAILOPAN is offline
Olly
Senior Member
Join Date: Mar 2007
Location: UK
Old 05-16-2007 , 05:21   Re: [EXTENSION] Sockets
Reply With Quote #18

New update, see first post

1.0.2.0
  • Fixed lots of null pointer crashes ><
  • Fixed the native name in the include for SocketClose
  • Fixed functag
  • Compiled for linux
Olly is offline
Send a message via MSN to Olly
sskillz
Member
Join Date: Apr 2005
Old 05-16-2007 , 08:58   Re: [EXTENSION] Sockets
Reply With Quote #19

good work.
but how do can I check or know if the socket has closed ?
sskillz is offline
Olly
Senior Member
Join Date: Mar 2007
Location: UK
Old 05-16-2007 , 12:29   Re: [EXTENSION] Sockets
Reply With Quote #20

uhh, at the moment you cant, ill add connect/disconnect callbacks tonight
Olly is offline
Send a message via MSN to Olly
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode