Commit Graph

10 Commits

Author SHA1 Message Date
Javivi
6a553122b1 Update sockets module (#301)
* Module rewrite

- WinSock version changed from 1.1 to 2.2.
- Properly check for WinSock initialization on OnAmxxAttach/Detach.
- Now natives will not be added if we can't start up WinSock.
- socket_open() is now IP version agnostic (both IPv4 and IPv6 are
supported).
- Error reporting has been changed on socket_open(), a new parameter
called _libc_errors has been added, and, if enabled, libc errors will be
returned instead of the previous made-up errors.
- socket_close() now returns a value on success/failure.
- Added non-blocking sockets at socket_open_nb().
- Added socket_is_writable() to check if a socket is ready for write.
- Added socket_is_readable() as an alias to socket_change().
- Code rewritten to be more readable, it should be self-explaining now.

* Update docs and fix AMBuild

Updated documentation following the guidelines

* Fixs for the module

- Fixed the backwards compatibility with the return codes
- Merged socket_connect and socket_connect_nb
- Added a 5th parameter to socket_open that takes bit flags to enable
the new features (libc errors & nonblocking sockets)
- Fixed an error on socket_send2 that caused the buffet not to start
from the beginning if multiple calls were made
- Updated docs
- [docs] Prefixed error codes with SOCK_
- [docs] Added the new flags SOCK_NON_BLOCKING and SOCK_LIBC_ERRORS
- [docs] Added a new stock called SOCK_ERROR_EINPROGRESS(error) to be
used when checking if a newly created nonblocking socket is connecting

* Fixes for the docs

Fix some typos, shorten lines, document SOCK_ERROR_EINPROGRESS

* Document magic numbers

No more magic

* Revert "Document magic numbers"

This reverts commit 0f233292063400ea7fdbcd5e5d5cd6e54f8cd71c.

* More docs fixes

* Fix broken socket_send2()

* Add error checking in send2()

* Remove stock

It should not be needed because nb sockets should always be checked or
writability

* Fix some identations

* Fix return codes doc

* Fix socket_recv() regression

strncopy will stop on a null byte, that makes the function unusable to
receive binary data

* More docs typo fixes
2017-03-03 19:56:22 +01:00
xPaw
379d9121b4 Remove version checks from all include files 2015-02-25 00:56:17 +02:00
Valentin Grünbacher
1fb91dc02e Merge branch 'master' of ssh://github.com/alliedmodders/amxmodx into inc-doc
Conflicts:
	plugins/include/amxmodx.inc
	plugins/include/message_const.inc
	plugins/include/sockets.inc
2014-08-07 01:44:04 +02:00
Valentin Grünbacher
c1ed795196 sockets: Convert file to UTF-8 2014-08-07 00:51:17 +02:00
Scott Ehlert
f787db1be5 Update license headers for plugins and includes. 2014-08-04 13:18:41 -05:00
Steve Dudenhoeffer
dd8f138892 Back ported revision 3242 - Every include file now is const correct (am49281) 2007-01-26 05:56:10 +00:00
David Anderson
25d4b6aea3 added these include files k 2006-05-10 10:42:49 +00:00
Borja Ferrer
2ebf822dea added new socket send native 2005-12-05 01:49:16 +00:00
David Anderson
74ec2e75b8 New auto-module system 2005-07-15 19:05:31 +00:00
David Anderson
5043a40c51 Synced include files 2004-09-10 03:12:38 +00:00