我有以下功能:在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