class xis_socket_observer{
public:
virtual ~xis_socket_observer() {}
virtual xis_void on_socket_connected(xis_socket* psocket, const xis_cchar* phost, xis_uint port) = 0;
virtual xis_void on_socket_disconnect(xis_socket* psocket) = 0;
virtual xis_void on_socket_error(xis_socket* psocket, xis_sint errcode, const xis_cchar* perrmsg) = 0;
virtual xis_sint on_socket_recv(xis_socket* psocket, xis_byte* pdata, xis_sint datalen) = 0;
virtual xis_void on_socket_send(xis_socket* psocket, xis_sint idlesize) = 0; //idlesize socket send buffer 空限量
};
class xis_socket : public xis_object_ref{
friend class xis_sock_service;
private:
xis_socket_observer* mpobserver;
下面的这个用纯虚类指针指向 一个成员,这样可以么?