update
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "sys/epoll.h"
|
||||
#include "sys/socket.h"
|
||||
#include "arpa/inet.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
void *os_alloc(uint64 capacity) {
|
||||
@@ -226,7 +227,7 @@ Socket *serverAccept(Server *s) {
|
||||
epoll_ctl(((EPollServerEvents *)s->events)->epollFd, EPOLL_CTL_ADD, clientSockHandle, &event);
|
||||
|
||||
if (s->clients.length < s->clients.capacity) {
|
||||
AppendList(&s->clients, ((Socket){
|
||||
ListAppend(s->clients, ((Socket){
|
||||
.handle=(SocketHandle *)(uint64)clientSockHandle,
|
||||
.address=(Address *)clientAddr,
|
||||
}));
|
||||
@@ -280,7 +281,7 @@ ServerEvent *serverGetNextEvent(Server *s) {
|
||||
}
|
||||
|
||||
if (serverEvents->userEvents.length == 0) {
|
||||
AppendList(&serverEvents->userEvents, (ServerEvent){ .type=ServerEventType_None });
|
||||
ListAppend(serverEvents->userEvents, (ServerEvent){ .type=ServerEventType_None });
|
||||
}
|
||||
|
||||
// Pop next event
|
||||
@@ -354,10 +355,10 @@ Socket socketConnect(Arena *arena, SocketConnectInfo info) {
|
||||
Socket result = {
|
||||
.handle=(SocketHandle *)(uint64)socketFd,
|
||||
.address=(Address *)remoteAddr,
|
||||
.closed=false,
|
||||
//.closed=connectErr == -1,
|
||||
.closed=connectErr == -1,
|
||||
// TODO(dledda): investigate error behaviour
|
||||
};
|
||||
perror("errconn");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user