00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __JackMachServerChannel__
00021 #define __JackMachServerChannel__
00022
00023 #include "JackChannel.h"
00024 #include "JackPlatformPlug.h"
00025 #include "JackMachPort.h"
00026 #include <map>
00027
00028 namespace Jack
00029 {
00030
00031 class JackServer;
00032 class JackLockedEngine;
00033
00038 class JackMachServerChannel : public JackRunnableInterface
00039 {
00040
00041 private:
00042
00043 JackMachPortSet fServerPort;
00044 JackThread fThread;
00045 JackServer* fServer;
00046 std::map<mach_port_t, int> fClientTable;
00047
00048 static boolean_t MessageHandler(mach_msg_header_t* Request, mach_msg_header_t* Reply);
00049
00050 public:
00051
00052 JackMachServerChannel();
00053 ~JackMachServerChannel();
00054
00055 int Open(const char* server_name, JackServer* server);
00056 void Close();
00057
00058 JackLockedEngine* GetEngine();
00059 JackServer* GetServer();
00060
00061 void ClientCheck(char* name, char* name_res, int protocol, int options, int* status, int* result);
00062 void ClientOpen(char* name, int pid, mach_port_t* private_port, int* shared_engine, int* shared_client, int* shared_graph, int* result);
00063 void ClientClose(mach_port_t private_port, int refnum);
00064 void ClientKill(mach_port_t private_port);
00065
00066 bool Execute();
00067
00068 static std::map<mach_port_t, JackMachServerChannel*> fPortTable;
00069 };
00070
00071 }
00072
00073 #endif
00074