Salut,<br><br>Ms. Am rezolvat cu testul 1 [eu ieseam din client -1].<br>Acum la testul 2 cu verificarea api-ului folosit imi da failed, desi am in cod epoll_ctl, epoll_create, epoll_wait etc.<br><br>Testul 2 arata asa :<br>
=================<br>nm ../server | grep epoll_ctl &&\<br>nm ../server | grep epoll_wait &&\<br>nm ../server | grep epoll_create &&\<br>nm ../server | grep io_setup &&\<br>nm ../server | grep io_submit &&\<br>
nm ../server | grep eventfd<br><br>if [ $? -ne 0 ]<br> then do_exit 1<br> else do_exit 0<br>fi<br>==================<br><br>Iar mie cand rulez checkerul imi da :<br><br>==================<br>Started test 02...<br> U epoll_ctl@@GLIBC_2.3.2<br>
U epoll_wait@@GLIBC_2.3.2<br> U epoll_create@@GLIBC_2.3.2<br>-- FAILED --<br>=================<br><br>In cod functiile le-am folosit doar in server astfel :<br><br>==================<br> //pentru epoll:<br>
int epfd;<br> struct epoll_event *events = (struct epoll_event*) calloc(MAX_CLIENTS, sizeof(struct epoll_event));<br> if (events == NULL) {<br> perror (" eroare la alocare events \n");<br>
return -1;<br> }<br><br> struct epoll_event ev;<br><br> //incep sa primesc clientii si sa le procesez cererile<br> epfd = epoll_create(MAX_CLIENTS);<br> if(epfd == -1)<br> {<br>
perror("epoll_create\n");<br> return -1;<br> }<br> ev.events = EPOLLIN | EPOLLERR | EPOLLHUP;<br> ev.data.fd = listenfd;<br> er = epoll_ctl(epfd, EPOLL_CTL_ADD, listenfd, &ev);<br>
if (er < 0)<br> {<br> perror("epoll_ctl, adding listenfd\n");<br> exit(1);<br> }<br> <br><br> //adaug eventfd la files descriptorii asociati<br> ev.data.fd = evfd;<br>
ev.events = EPOLLIN;<br><br><br> for( ; ; )<br> {<br> res = epoll_wait(epfd, events, MAX_CLIENTS, 0);<br> .... diverse prelucrari <br> }<br>=================================<br>
<br>Imi puteti spune ce gresesc aici? <br><br>Multumesc inca o data<br><br>Ana <br>332cc<br><br><br><br><br><br><br>