45    protected bool $ready = 
false;
 
   46    protected string $mainPath;
 
   56        protected ThreadSafeArray $mainToThreadBuffer,
 
   57        protected ThreadSafeArray $threadToMainBuffer,
 
   59        protected int $serverId,
 
   60        protected int $maxMtuSize,
 
   61        protected int $protocolVersion,
 
   64        $this->mainPath = \pocketmine\PATH;
 
 
   68    public function startAndWait(
int $options = NativeThread::INHERIT_NONE) : void{
 
   69        $this->start($options);
 
   70        $this->
synchronized(
function() : 
void{
 
   71            while(!$this->ready && !$this->isTerminated()){
 
   75        $crashInfo = $this->getCrashInfo();
 
   76        if($crashInfo !== 
null){
 
   77            if($crashInfo->getType() === SocketException::class){
 
   78                throw new SocketException($crashInfo->getMessage());
 
   84    protected function onRun() : void{
 
   89        ini_set(
"display_errors", 
'1');
 
   90        ini_set(
"display_startup_errors", 
'1');
 
   91        \GlobalLogger::set($this->logger);
 
   93        $socket = 
new ServerSocket($this->address->deserialize());
 
   94        $manager = 
new Server(
 
   99            new SimpleProtocolAcceptor($this->protocolVersion),
 
  100            new UserToRakLibThreadMessageReceiver(
new PthreadsChannelReader($this->mainToThreadBuffer)),
 
  101            new RakLibToUserThreadMessageSender(
new SnoozeAwarePthreadsChannelWriter($this->threadToMainBuffer, $this->sleeperEntry->createNotifier())),
 
  102            new ExceptionTraceCleaner($this->mainPath),
 
  103            recvMaxSplitParts: 512
 
  105        $this->
synchronized(
function() : 
void{
 
  109        while(!$this->isKilled){
 
  110            $manager->tickProcessor();
 
  112        $manager->waitShutdown();
 
  115    public function getThreadName() : string{
 
 
__construct(protected ThreadSafeLogger $logger, protected ThreadSafeArray $mainToThreadBuffer, protected ThreadSafeArray $threadToMainBuffer, InternetAddress $address, protected int $serverId, protected int $maxMtuSize, protected int $protocolVersion, protected SleeperHandlerEntry $sleeperEntry)