我有以下功能:在pthread_create:传递一个参数作为最后一个参数
void Servlet(SSL* ssl) /* Serve the connection -- threadable */
{ char buf[1024];
char reply[1024];
int sd, bytes;
const char* HTMLecho="<html><body><pre>%s</pre></body></html>\n\n";
if (SSL_accept(ssl) == FAIL) /* do SSL-protocol accept */
ERR_print_errors_fp(stderr);
else
{
ShowCerts(ssl); /* get any certificates */
bytes = SSL_read(ssl, buf, sizeof(buf)); /* get request */
if (bytes > 0)
{
buf[bytes] = 0;
printf("Client msg: \"%s\"\n", buf);
sprintf(reply, HTMLecho, buf); /* construct reply */
SSL_write(ssl, reply, strlen(reply)); /* send reply */
}
else
ERR_print_errors_fp(stderr);
}
sd = SSL_get_fd(ssl); /* get socket connection */
SSL_free(ssl); /* release SSL state */
close(sd); /* close connection */
}
,并在主要部分程序:
pthread_create(&threadA[noThread], NULL, Servlet,(SSL*)(ssl));
但编译后,我看到错误的论点3在pthread_create!如何解决它?
*“我看到错误说法3在pthread_create如何解决它! “*。第一步:阅读错误消息。 – user2079303
错误消息“无效对话从void(*)(ssl *)到void *(*)(void *)[-fpermisive]” – user8178737
您应该将相关信息放入问题中。 – user2079303