47 lines
857 B
C
Raw Normal View History

2014-09-17 16:43:05 +03:00
#include "interface/event.h"
namespace network
{
struct PeerInfo
{
typedef size_t Id;
2014-09-17 20:15:46 +03:00
2014-09-17 16:43:05 +03:00
Id id = 0;
ss_ address;
};
struct Packet: public interface::Event::Private
{
typedef size_t Type;
2014-09-17 20:15:46 +03:00
PeerInfo::Id recipient;
Type type; // TODO: Allow supplying a name directly here alternatively
2014-09-17 16:43:05 +03:00
ss_ data;
Packet(PeerInfo::Id recipient, const Type &type, const ss_ &data):
recipient(recipient), type(type), data(data){}
2014-09-17 16:43:05 +03:00
};
struct NewClient: public interface::Event::Private
2014-09-17 16:43:05 +03:00
{
2014-09-17 20:15:46 +03:00
PeerInfo info;
NewClient(const PeerInfo &info): info(info){}
2014-09-17 20:15:46 +03:00
};
struct Req_get_packet_type: public interface::Event::Private
{
ss_ name;
Req_get_packet_type(const ss_ &name): name(name){}
};
struct Resp_get_packet_type: public interface::Event::Private
{
Packet::Type type;
Resp_get_packet_type(const Packet::Type &type): type(type){}
};
2014-09-17 16:43:05 +03:00
}