Ejemplo n.º 1
0
        public virtual int start(int evthPri, int evthStack, int inthPri, int inthStack, int optLen, int optData)
        {
            try
            {
                setHelloOpt(optLen, optData);
                openSocket();

                ThreadManForUser threadMan = Modules.ThreadManForUserModule;
                if (eventThread == null)
                {
                    eventThread = threadMan.hleKernelCreateThread("SceNetAdhocMatchingEvent", ThreadManForUser.NET_ADHOC_MATCHING_EVENT_LOOP_ADDRESS, evthPri, evthStack, threadMan.CurrentThread.attr, 0, SysMemUserForUser.USER_PARTITION_ID);
                    threadMan.hleKernelStartThread(eventThread, 0, 0, eventThread.gpReg_addr);
                    eventThread.cpuContext.setRegister(sceNetAdhocMatching.loopThreadRegisterArgument, Id);
                }
                if (inputThread == null)
                {
                    inputThread = threadMan.hleKernelCreateThread("SceNetAdhocMatchingInput", ThreadManForUser.NET_ADHOC_MATCHING_INPUT_LOOP_ADDRESS, inthPri, inthStack, threadMan.CurrentThread.attr, 0, SysMemUserForUser.USER_PARTITION_ID);
                    threadMan.hleKernelStartThread(inputThread, 0, 0, inputThread.gpReg_addr);
                    inputThread.cpuContext.setRegister(sceNetAdhocMatching.loopThreadRegisterArgument, Id);
                }

                // Add myself as the first member
                addMember(Wlan.MacAddress);

                started = true;
            }
            catch (SocketException e)
            {
                Console.WriteLine("start", e);
            }
            catch (UnknownHostException e)
            {
                Console.WriteLine("start", e);
            }
            catch (IOException e)
            {
                Console.WriteLine("start", e);
            }

            return(0);
        }
Ejemplo n.º 2
0
        public virtual int sceNetApctlInit(int stackSize, int initPriority)
        {
            if (sceNetApctlThread == null)
            {
                ThreadManForUser threadMan = Modules.ThreadManForUserModule;
                sceNetApctlThread          = threadMan.hleKernelCreateThread("SceNetApctl", ThreadManForUser.NET_APCTL_LOOP_ADDRESS, initPriority, stackSize, threadMan.CurrentThread.attr, 0, SysMemUserForUser.USER_PARTITION_ID);
                sceNetApctlThreadTerminate = false;
                threadMan.hleKernelStartThread(sceNetApctlThread, 0, 0, sceNetApctlThread.gpReg_addr);
            }

            return(0);
        }