Update functions to their respective methodmaps
This commit is contained in:
@@ -30,7 +30,7 @@ public Action CommandTest(int client, int args)
|
|||||||
// open a file handle for writing the result
|
// open a file handle for writing the result
|
||||||
// new Socket hFile = OpenFile("dl.htm", "wb");
|
// new Socket hFile = OpenFile("dl.htm", "wb");
|
||||||
// pass the file handle to the callbacks
|
// pass the file handle to the callbacks
|
||||||
//SocketSetArg(socket, hFile);
|
// socket.SetArg(hFile);
|
||||||
// connect the socket
|
// connect the socket
|
||||||
socket.Connect(OnSocketConnected, OnSocketReceive, OnSocketDisconnected, "www.sourcemod.net", 80);
|
socket.Connect(OnSocketConnected, OnSocketReceive, OnSocketDisconnected, "www.sourcemod.net", 80);
|
||||||
|
|
||||||
@@ -42,14 +42,14 @@ public void OnSocketConnected(Socket socket, any hFile) {
|
|||||||
|
|
||||||
char requestStr[100];
|
char requestStr[100];
|
||||||
Format(requestStr, sizeof(requestStr), "GET /%s HTTP/1.0\r\nHost: %s\r\nConnection: close\r\n\r\n", "index.php", "www.sourcemod.net");
|
Format(requestStr, sizeof(requestStr), "GET /%s HTTP/1.0\r\nHost: %s\r\nConnection: close\r\n\r\n", "index.php", "www.sourcemod.net");
|
||||||
SocketSend(socket, requestStr);
|
socket.Send(requestStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSocketReceive(Socket socket, char[] receiveData, const int dataSize, any hFile) {
|
public void OnSocketReceive(Socket socket, char[] receiveData, const int dataSize, any hFile) {
|
||||||
// receive another chunk and write it to <modfolder>/dl.htm
|
// receive another chunk and write it to <modfolder>/dl.htm
|
||||||
// we could strip the http response header here, but for example's sake we'll leave it in
|
// we could strip the http response header here, but for example's sake we'll leave it in
|
||||||
|
|
||||||
//WriteFileString(hFile, receiveData, false);
|
// hFile.WriteString(receiveData, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSocketDisconnected(Socket socket, any hFile) {
|
public void OnSocketDisconnected(Socket socket, any hFile) {
|
||||||
|
|||||||
Reference in New Issue
Block a user