
-----------------------------------
Pyroguy
Wed Dec 31, 2003 8:20 pm

stupid winsock...
-----------------------------------
i'm just starting experimenting with winsock... but i've been having a problem with the accept function... for some reason i can't figure out it gives me a cannot convert `bool' to `int*' for argument `3' to ` on line 37... can anyone help??? oh yeah this is the server by the way

#include 
#include 

#define PORT 5000
using namespace std;
int main () 
{
    WSAData wsaData;
    if (WSAStartup(MAKEWORD(1,1), &wsaData) != 1) 
    {
        fprintf(stderr, "WSAStartup failed.\n");
        exit(1);
    }
    int mysock = socket(AF_INET, SOCK_STREAM, 0);
    int list_sock;
    struct sockaddr_in sockinfo;
    struct sockaddr_in theirsockinfo;
    sockinfo.sin_family = AF_INET;
    sockinfo.sin_port = htons(PORT);
    sockinfo.sin_addr.s_addr = htonl(INADDR_ANY);
    memset(&(sockinfo.sin_zero),'\0',8); 
    if (bind(mysock, (struct sockaddr*)&sockinfo, sizeof(struct sockaddr)) != 0)
    {
        fprintf (stderr, "Error binding socket.\n");
        exit(1);
    }
    if (listen(mysock, 10) != 0) 
    {
        fprintf(stderr, "Error listening on socket... isn't bu gay?.\n");
        exit(1);
    }
    int sinsize;
    int datasend, datalen;
    char* data;
    sinsize = sizeof(struct sockaddr_in);
    
    if (list_sock = accept(mysock, (struct sockaddr*)&theirsockinfo, &sinsize != 0)
    {
        fprintf(stderr, "Could not accept request\n");
        exit(1)
    }
    while(1)
    {

        cin