updated syntax slightly, updated socket, made silly stuff for postforwards
This commit is contained in:
parent
489cc52bd5
commit
241135566a
@ -294,7 +294,7 @@ typeset SocketErrorCB
|
|||||||
* @param socket Socket handle to check
|
* @param socket Socket handle to check
|
||||||
* @return bool The connection status
|
* @return bool The connection status
|
||||||
*/
|
*/
|
||||||
native bool:SocketIsConnected(Handle:socket);
|
native bool SocketIsConnected(Handle socket);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -316,7 +316,7 @@ native Handle SocketCreate(SocketType protocol=SOCKET_TCP, SocketErrorCB efunc);
|
|||||||
* @param cell_t port The port to bind the socket to.
|
* @param cell_t port The port to bind the socket to.
|
||||||
* @return bool true on success
|
* @return bool true on success
|
||||||
*/
|
*/
|
||||||
native bool:SocketBind(Handle:socket, const String:hostname[], port);
|
native bool SocketBind(Handle socket, const char[] hostname, char port);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connects a socket
|
* Connects a socket
|
||||||
@ -333,7 +333,7 @@ native bool:SocketBind(Handle:socket, const String:hostname[], port);
|
|||||||
* @param cell_t port The port to connect to.
|
* @param cell_t port The port to connect to.
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
native SocketConnect(Handle:socket, SocketConnectCB:cfunc, SocketReceiveCB:rfunc, SocketDisconnectCB:dfunc, const String:hostname[], port);
|
native void SocketConnect(Handle socket, SocketConnectCB cfunc, SocketReceiveCB rfunc, SocketDisconnectCB dfunc, const char[] hostname, char port);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disconnects a socket
|
* Disconnects a socket
|
||||||
@ -343,7 +343,7 @@ native SocketConnect(Handle:socket, SocketConnectCB:cfunc, SocketReceiveCB:rfunc
|
|||||||
*
|
*
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
native bool:SocketDisconnect(Handle:socket);
|
native bool SocketDisconnect(Handle socket);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes a socket listen for incoming connections
|
* Makes a socket listen for incoming connections
|
||||||
@ -352,7 +352,7 @@ native bool:SocketDisconnect(Handle:socket);
|
|||||||
* @param SocketIncomingCB ifunc The callback for incoming connections
|
* @param SocketIncomingCB ifunc The callback for incoming connections
|
||||||
* @return bool true on success
|
* @return bool true on success
|
||||||
*/
|
*/
|
||||||
native bool:SocketListen(Handle:socket, SocketIncomingCB:ifunc);
|
native bool SocketListen(Handle socket, SocketIncomingCB ifunc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends data through the socket.
|
* Sends data through the socket.
|
||||||
@ -368,7 +368,7 @@ native bool:SocketListen(Handle:socket, SocketIncomingCB:ifunc);
|
|||||||
* @param String data The data to send.
|
* @param String data The data to send.
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
native SocketSend(Handle:socket, const String:data[], size=-1);
|
native void SocketSend(Handle socket, const char[] data, int size=-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends UDP data through the socket to a specific destination.
|
* Sends UDP data through the socket to a specific destination.
|
||||||
@ -386,7 +386,7 @@ native SocketSend(Handle:socket, const String:data[], size=-1);
|
|||||||
* @param cell_t port The port to send to.
|
* @param cell_t port The port to send to.
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
native SocketSendTo(Handle:socket, const String:data[], size=-1, const String:hostname[], port);
|
native void SocketSendTo(Handle socket, const char[] data, int size=-1, const char[] hostname, int port);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a socket option.
|
* Set a socket option.
|
||||||
@ -396,7 +396,7 @@ native SocketSendTo(Handle:socket, const String:data[], size=-1, const String:ho
|
|||||||
* @param cellt_ value The value to set the option to.
|
* @param cellt_ value The value to set the option to.
|
||||||
* @return cell_t 1 on success.
|
* @return cell_t 1 on success.
|
||||||
*/
|
*/
|
||||||
native SocketSetOption(Handle:socket, SocketOption:option, value);
|
native void SocketSetOption(Handle socket, SocketOption option, int value);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -409,7 +409,7 @@ native SocketSetOption(Handle:socket, SocketOption:option, value);
|
|||||||
* @param SocketReceiveCB rfunc The receive callback
|
* @param SocketReceiveCB rfunc The receive callback
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
native SocketSetReceiveCallback(Handle:socket, SocketReceiveCB:rfunc);
|
native void SocketSetReceiveCallback(Handle socket, SocketReceiveCB rfunc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the callback function for when the socket sent all items in its send queue
|
* Defines the callback function for when the socket sent all items in its send queue
|
||||||
@ -422,7 +422,7 @@ native SocketSetReceiveCallback(Handle:socket, SocketReceiveCB:rfunc);
|
|||||||
* @param SocketDisconnectCB dfunc The disconnect callback
|
* @param SocketDisconnectCB dfunc The disconnect callback
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
native SocketSetSendqueueEmptyCallback(Handle:socket, SocketSendqueueEmptyCB:sfunc);
|
native void SocketSetSendqueueEmptyCallback(Handle socket, SocketSendqueueEmptyCB sfunc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the callback function for when the socket was properly disconnected by the remote side
|
* Defines the callback function for when the socket was properly disconnected by the remote side
|
||||||
@ -434,7 +434,7 @@ native SocketSetSendqueueEmptyCallback(Handle:socket, SocketSendqueueEmptyCB:sfu
|
|||||||
* @param SocketDisconnectCB dfunc The disconnect callback
|
* @param SocketDisconnectCB dfunc The disconnect callback
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
native SocketSetDisconnectCallback(Handle:socket, SocketDisconnectCB:dfunc);
|
native void SocketSetDisconnectCallback(Handle socket, SocketDisconnectCB dfunc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the callback function for when the socket triggered an error
|
* Defines the callback function for when the socket triggered an error
|
||||||
@ -446,7 +446,7 @@ native SocketSetDisconnectCallback(Handle:socket, SocketDisconnectCB:dfunc);
|
|||||||
* @param SocketErrorCB efunc The error callback
|
* @param SocketErrorCB efunc The error callback
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
native SocketSetErrorCallback(Handle:socket, SocketErrorCB:efunc);
|
native void SocketSetErrorCallback(Handle socket, SocketErrorCB efunc);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -456,7 +456,7 @@ native SocketSetErrorCallback(Handle:socket, SocketErrorCB:efunc);
|
|||||||
* @param any arg The argument to set
|
* @param any arg The argument to set
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
native SocketSetArg(Handle:socket, any:arg);
|
native void SocketSetArg(Handle socket, any arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the local system's hostname as the command "hostname" does.
|
* Retrieve the local system's hostname as the command "hostname" does.
|
||||||
@ -466,12 +466,12 @@ native SocketSetArg(Handle:socket, any:arg);
|
|||||||
*
|
*
|
||||||
* @return 1 on success
|
* @return 1 on success
|
||||||
*/
|
*/
|
||||||
native SocketGetHostName(String:dest[], destLen);
|
native void SocketGetHostName(char[] dest, int destLen);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _________________Do not edit below this line!_______________________
|
* _________________Do not edit below this line!_______________________
|
||||||
*/
|
*/
|
||||||
public Extension:__ext_smsock =
|
public Extension __ext_smsock =
|
||||||
{
|
{
|
||||||
name = "Socket",
|
name = "Socket",
|
||||||
file = "socket.ext",
|
file = "socket.ext",
|
||||||
|
Loading…
Reference in New Issue
Block a user