Beispiel #1
0
struct harbor *
harbor_create(void) {
	struct harbor * h = malloc(sizeof(*h));
	h->id = 0;
	h->master_fd = -1;
	h->master_addr = NULL;
	int i;
	for (i=0;i<REMOTE_MAX;i++) {
		h->remote_fd[i] = -1;
		h->remote_addr[i] = NULL;
	}
	h->map = _hash_new();
	return h;
}
HARBOR_API struct harbor *
harbor_create(void) {
	struct harbor * h = (struct harbor *)skynet_malloc(sizeof(*h));
	h->ctx = NULL;
	h->id = 0;
	h->master_fd = -1;
	h->master_addr = NULL;
	int i;
	for (i=0;i<REMOTE_MAX;i++) {
		h->remote_fd[i] = -1;
		h->connected[i] = false;
		h->remote_addr[i] = NULL;
	}
	h->map = _hash_new();
	return h;
}
Beispiel #3
0
struct dummy *
dummy_create(void) {
	struct dummy * d = skynet_malloc(sizeof(*d));
	d->map = _hash_new();
	return d;
}