IoSocket *IoSocket_newWithSocket_(void *state, Socket *socket) { IoSocket *self = IoSocket_new(state); Socket_free(SOCKET(self)); IoObject_setDataPointer_(self, socket); return self; }
void initSocketAddons(IoState* state) { IoState_addTagWithInitFunc_(state, IoSocket_initTagWithId_); IoObject_setSlot_to_(state->lobby, IoState_stringWithCString_(state, "Socket"), IoSocket_new(state)); }
IoValue *IoSocket_clone(IoSocket *self, IoValue *locals, IoMessage *m) { IoSocket *newSocket = IoSocket_new(self->tag->state); newSocket->host = strdup(self->host); return (IoValue *)newSocket; }