/*
 * socket for winsock2 copyright (C) 2009 - 2012 H.Niwa
 */

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 */

#ifndef __WINSOCK2UTIL_H
#define __WINSOCK2UTIL_H

#ifdef __MINGW32__
#define SOCKET	long

extern void RetrySleep(int t);
extern void winsock2init();
extern void winsock2end();
extern void tcppr(SOCKET sock, const char* sendtext);
extern SOCKET tcpopen(const char* hostname, const char* path, const char* port);
extern void tcprecv(std::string &recvtextbody, SOCKET sock);
extern void tcpclose(SOCKET sock);

#endif /* __MINGW32__ */

#endif /* __WINSOCK2UTIL_H */

