mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 11:33:09 +00:00
32 lines
714 B
C
32 lines
714 B
C
#ifndef SKYNET_HARBOR_H
|
|
#define SKYNET_HARBOR_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
|
|
#define GLOBALNAME_LENGTH 16
|
|
#define REMOTE_MAX 256
|
|
|
|
// reserve high 8 bits for remote id
|
|
#define HANDLE_MASK 0xffffff
|
|
#define HANDLE_REMOTE_SHIFT 24
|
|
|
|
struct remote_name {
|
|
char name[GLOBALNAME_LENGTH];
|
|
uint32_t handle;
|
|
};
|
|
|
|
struct remote_message {
|
|
struct remote_name destination;
|
|
const void * message;
|
|
size_t sz;
|
|
};
|
|
|
|
void skynet_harbor_send(struct remote_message *rmsg, uint32_t source, int session);
|
|
void skynet_harbor_register(struct remote_name *rname);
|
|
int skynet_harbor_message_isremote(uint32_t handle);
|
|
void skynet_harbor_init(int harbor);
|
|
int skynet_harbor_start(const char * master, const char *local);
|
|
|
|
#endif
|