Original Post
I have a C++ class ServerSocket which has a method called accept. The accept method calls the accept function but this gives me an error. It tries to execute a version of accept that is part of class definition instead. Is there a way to run the function accept versus the classes method?
int ServerSocket::accept()
{
int newfd;
socklen_t size = sizeof(clientAddr);
//call to the accept function
if( (newfd = accept(sockfd, (struct sockaddr *)&clientAddr, &size)) == -1)
{
return -1;
}
return newfd;
}