mirror of
http://deavmi.assigned.network/git/deavmi/tristanable
synced 2025-02-17 21:36:48 +00:00
One must now explicitly start tristanable
This commit is contained in:
parent
35e7b6e3b3
commit
9da01c7376
@ -35,6 +35,9 @@ Queue instantNotification = new Queue(2);
|
||||
manager.addQueue(weatherQueue);
|
||||
manager.addQueue(instantNotification);
|
||||
|
||||
/* We can tell tristanable to start reading from the socket now */
|
||||
manager.start();
|
||||
|
||||
/* Now we can block on this queue and return with its head */
|
||||
QueueItem message = weatherQueue.dequeue();
|
||||
```
|
||||
|
@ -52,9 +52,6 @@ public final class Manager
|
||||
{
|
||||
/* TODO: Make sure the socket is in STREAM mode */
|
||||
|
||||
/* Set this session as alive */
|
||||
this.isAlive = true;
|
||||
|
||||
/* Set the socket */
|
||||
this.socket = socket;
|
||||
|
||||
@ -65,6 +62,18 @@ public final class Manager
|
||||
watcher = new Watcher(this, socket, timeOut, newSys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the session (watcher)
|
||||
*/
|
||||
public void start()
|
||||
{
|
||||
/* Set this session as alive */
|
||||
this.isAlive = true;
|
||||
|
||||
/* Start the watcher */
|
||||
watcher.start();
|
||||
}
|
||||
|
||||
public Queue getQueue(ulong tag)
|
||||
{
|
||||
Queue matchingQueue;
|
||||
|
@ -43,11 +43,7 @@ public final class Watcher : Thread
|
||||
initSelect();
|
||||
}
|
||||
|
||||
|
||||
this.timeOut = timeOut;
|
||||
|
||||
running = true;
|
||||
start();
|
||||
this.timeOut = timeOut;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,6 +68,8 @@ public final class Watcher : Thread
|
||||
|
||||
private void run()
|
||||
{
|
||||
running = true;
|
||||
|
||||
/* Continuously dequeue tristanable packets from socket */
|
||||
while(true)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user