This is a complete console program compiled with Microsoft Visual Studio 2012 that demonstrates how to access the api from (SFS). The program sends a list of ip address to SFS and gets a reply that indicates which ones have been reported as spammers. The list of IP addresses is obtained from a tab deliminated file which was generated from a vBulletin forum web site. You can easily modify the program to get the list of ip address from some other stream.\r\n
#include "Socket.h"
#include
#include // required for SHGetSpecialFolderPath()
#include
#include
#include
AncientDragon
17th May 2013, 08:01
/*
Socket.cpp
Copyright (C) 2002-2004 René Nyffenegger
This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original source code.
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger
*/
#include "Socket.h"
#include
using namespace std;
int Socket::nofSockets_= 0;
void Socket::Start() {
if (!nofSockets_) {
WSADATA info;
if (WSAStartup(MAKEWORD(2,0),
AncientDragon
17th May 2013, 08:01
/*
Socket.h
Copyright (C) 2002-2004 René Nyffenegger
This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original source code.
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger
*/
#ifndef SOCKET_H
#define SOCKET_H
#include
#include
#pragma warning(disable: 4996)
enum TypeSocket {BlockingSocket, NonBlockingSocket};
class Socket {
public:
virtual ~Socket();
Socket(const Socket