From c986830f3c13ac70829430f84115b18f229579f9 Mon Sep 17 00:00:00 2001 From: michelou Date: Sun, 8 Oct 2006 21:07:23 +0000 Subject: modified escapedStringValue and cleaned up comm... modified escapedStringValue and cleaned up comments --- src/actors/scala/actors/Actor.scala | 156 ++++++++++++--------- src/actors/scala/actors/Channel.scala | 48 ++++--- src/actors/scala/actors/Reactor.scala | 86 ++++++------ src/actors/scala/actors/Scheduler.scala | 66 +++++---- src/actors/scala/actors/ThreadedActor.scala | 10 ++ src/actors/scala/actors/TimerThread.scala | 14 +- .../scala/actors/remote/FreshNameCreator.scala | 10 ++ .../scala/actors/remote/JavaSerializer.scala | 14 +- src/actors/scala/actors/remote/NetKernel.scala | 23 ++- src/actors/scala/actors/remote/Serializer.scala | 12 +- src/actors/scala/actors/remote/Service.scala | 10 ++ src/actors/scala/actors/remote/TcpService.scala | 17 ++- 12 files changed, 293 insertions(+), 173 deletions(-) (limited to 'src/actors') diff --git a/src/actors/scala/actors/Actor.scala b/src/actors/scala/actors/Actor.scala index 873835d177..e0e60dadd7 100644 --- a/src/actors/scala/actors/Actor.scala +++ b/src/actors/scala/actors/Actor.scala @@ -1,23 +1,33 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors import scala.collection.mutable.HashSet /** - This object provides functions for the definition of actors and - reactors, as well as all actor operations, such as - receive, react, reply, - etc. - - @author Philipp Haller + * This object provides functions for the definition of actors and + * reactors, as well as all actor operations, such as + * receive, react, reply, + * etc. + * + * @author Philipp Haller */ object Actor { private[actors] val selfs = new java.util.WeakHashMap(16, 0.5f) /** - Returns the currently executing actor. Should be used instead - of this in all blocks of code executed by - actors. + * Returns the currently executing actor. Should be used instead + * of this in all blocks of code executed by + * actors. */ def self: Actor = synchronized { val t = Thread.currentThread() @@ -34,8 +44,8 @@ object Actor { } /** - Creates an instance of a thread-based actor executing body, - and starts it. + * Creates an instance of a thread-based actor executing body, + * and starts it. */ def actor(body: => Unit): ActorThread = synchronized { val actor = new ActorThread { @@ -46,9 +56,9 @@ object Actor { } /** - Creates an instance of a thread-based actor specifying a - channel which can be used for typed communication with other - actors. + * Creates an instance of a thread-based actor specifying a + * channel which can be used for typed communication with other + * actors. */ def actor[a](ch: Channel[a])(body: => Unit): ActorThread = synchronized { val actor = new ActorThread { @@ -60,8 +70,8 @@ object Actor { } /** - Creates an instance of an event-based reactor executing - body, and starts it. + * Creates an instance of an event-based reactor executing + * body, and starts it. */ def reactor(body: => Unit): Reactor = synchronized { val reactor = new Reactor { @@ -72,12 +82,12 @@ object Actor { } /** - Receives a message from the mailbox of - self. Blocks if no message matching any of the - cases of f can be received. - - Only (thread-based) actors may call this method. It fails at - runtime if executed by a reactor. + * Receives a message from the mailbox of + * self. Blocks if no message matching any of the + * cases of f can be received. + * + * Only (thread-based) actors may call this method. It fails at + * runtime if executed by a reactor. */ def receive[a](f: PartialFunction[Any, a]): a = self.in.receive(f) @@ -244,10 +254,10 @@ object Actor { } /** - This trait defines commonalities between thread-based and - event-based actors. - - @author Philipp Haller + * This trait defines commonalities between thread-based and + * event-based actors. + * + * @author Philipp Haller */ trait Actor { @@ -269,21 +279,21 @@ trait Actor { } /** - The behavior of an actor is specified by implementing this - abstract method. Note that the preferred way to create actors - is through the actor and reactor - methods defined in object Actor. + * The behavior of an actor is specified by implementing this + * abstract method. Note that the preferred way to create actors + * is through the actor and reactor + * methods defined in object Actor. */ def act(): Unit /** - Sends msg to this actor (asynchronous). + * Sends msg to this actor (asynchronous). */ def !(msg: Any): Unit = in ! msg /** - Sends msg to this actor and awaits reply - (synchronous). + * Sends msg to this actor and awaits reply + * (synchronous). */ def !?(msg: Any): Any = in !? msg @@ -397,25 +407,25 @@ trait Actor { } /** - Messages of this type are sent to each actor a - that is linked to an actor b whenever - b terminates and a has - trapExit set to true. - - @author Philipp Haller + * Messages of this type are sent to each actor a + * that is linked to an actor b whenever + * b terminates and a has + * trapExit set to true. + * + * @author Philipp Haller */ case class Exit(from: Actor, reason: String) /** - This class provides an implementation for actors based on - threads. To be able to create instances of this class, the - inherited abstract method act() has to be - implemented. Note that the preferred way of creating - thread-based actors is through the actor method - defined in object Actor. - - @author Philipp Haller + * This class provides an implementation for actors based on + * threads. To be able to create instances of this class, the + * inherited abstract method act() has to be + * implemented. Note that the preferred way of creating + * thread-based actors is through the actor method + * defined in object Actor. + * + * @author Philipp Haller */ abstract class ActorThread extends Thread with ThreadedActor { override def run(): Unit = { @@ -456,10 +466,10 @@ abstract class ActorThread extends Thread with ThreadedActor { } /** - This class provides a dynamic actor proxy for normal Java - threads. - - @author Philipp Haller + * This class provides a dynamic actor proxy for normal Java + * threads. + * + * @author Philipp Haller */ private[actors] class ActorProxy(t: Thread) extends ThreadedActor { def act(): Unit = {} @@ -502,7 +512,7 @@ private[actors] class ActorProxy(t: Thread) extends ThreadedActor {
  actor {
    // ...
-   val c = select(TcpNode("127.0.0.1", 9010), 'myName)
+   val c = select(TcpNode("127.0.0.1", 9010), 'myName)
    c ! msg
    // ...
  }
@@ -517,8 +527,8 @@ object RemoteActor {
   private val kernels = new scala.collection.mutable.HashMap[Actor, NetKernel]
 
   /**
-   Makes self remotely accessible on TCP port
-   port.
+   * Makes self remotely accessible on TCP port
+   * port.
    */
   def alive(port: int): Unit = {
     val serv = new TcpService(port)
@@ -527,8 +537,8 @@ object RemoteActor {
   }
 
   /**
-   Registers a under name on this
-   node.
+   * Registers a under name on this
+   * node.
    */
   def register(name: Symbol, a: Actor): Unit = {
     val kernel = kernels.get(Actor.self) match {
@@ -544,8 +554,8 @@ object RemoteActor {
   }
 
   /**
-   Returns (a proxy for) the actor registered under
-   name on node.
+   * Returns (a proxy for) the actor registered under
+   * name on node.
    */
   def select(node: Node, name: Symbol): Actor =
     new Reactor {
@@ -575,16 +585,24 @@ object RemoteActor {
 
 
 /**
- This class represents a machine node on a TCP network.
-
- @author Philipp Haller
+ * This class represents a machine node on a TCP network.
+ *
+ * @author Philipp Haller
  */
 case class Node(address: String, port: Int)
 
 
 /**
- This class is used by our efficient message queue
- implementation.
+ * 

+ * This class is used by our efficient message queue + * implementation. + *

+ *
+ *
Direct Known Subclasses:
+ *
+ * MessageQueue + *
+ *
*/ private[actors] abstract class MessageQueueResult[Msg] { def msg: Msg @@ -592,12 +610,12 @@ private[actors] abstract class MessageQueueResult[Msg] { } /** - The class MessageQueue provides an efficient - implementation of a message queue specialized for this actor - library. Classes in this package are supposed to be the only - clients of this class. - - @author Martin Odersky, Philipp Haller + * The class MessageQueue provides an efficient + * implementation of a message queue specialized for this actor + * library. Classes in this package are supposed to be the only + * clients of this class. + * + * @author Martin Odersky, Philipp Haller */ private[actors] class MessageQueue[Msg] extends MessageQueueResult[Msg] { var msg: Msg = _ diff --git a/src/actors/scala/actors/Channel.scala b/src/actors/scala/actors/Channel.scala index a7e723f724..0121b97acd 100644 --- a/src/actors/scala/actors/Channel.scala +++ b/src/actors/scala/actors/Channel.scala @@ -1,3 +1,13 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors import Actor._ @@ -6,8 +16,8 @@ case object TIMEOUT class SuspendActorException extends Throwable { /* - For efficiency reasons we do not fill in - the execution stack trace. + * For efficiency reasons we do not fill in + * the execution stack trace. */ override def fillInStackTrace(): Throwable = { this @@ -15,11 +25,11 @@ class SuspendActorException extends Throwable { } /** - This class provides a means for typed communication among - actors. Only the actor creating an instance of a - Channel may receive from it. - - @author Philipp Haller + * This class provides a means for typed communication among + * actors. Only the actor creating an instance of a + * Channel may receive from it. + * + * @author Philipp Haller */ class Channel[Msg] { @@ -65,13 +75,13 @@ class Channel[Msg] { } /** - Sends msg to this Channel. + * Sends msg to this Channel. */ def !(msg: Msg): unit = send(msg, self) /** - Sends msg to this Channel and - awaits reply. + * Sends msg to this Channel and + * awaits reply. */ def !?(msg: Msg): Any = { self.freshReply() @@ -82,13 +92,13 @@ class Channel[Msg] { } /** - Forwards msg to this keeping the - last sender as sender instead of self. + * Forwards msg to this keeping the + * last sender as sender instead of self. */ def forward(msg: Msg): unit = send(msg, receiver.sender) /** - Receives a message from this Channel. + * Receives a message from this Channel. */ def receive[R](f: PartialFunction[Msg, R]): R = { assert(self == receiver, "receive from channel belonging to other actor") @@ -137,10 +147,10 @@ class Channel[Msg] { } /** - Receives a message from this Channel. If no - message could be received before msec - milliseconds elapsed, the TIMEOUT action is - executed if specified. + * Receives a message from this Channel. If no + * message could be received before msec + * milliseconds elapsed, the TIMEOUT action is + * executed if specified. */ def receiveWithin[R](msec: long)(f: PartialFunction[Any, R]): R = { assert(self == receiver, "receive from channel belonging to other actor") @@ -172,7 +182,7 @@ class Channel[Msg] { } /** - receive for reactors. + * receive for reactors. */ def react(f: PartialFunction[Any, Unit]): Nothing = { assert(self == receiver, "react on channel belonging to other actor") @@ -193,7 +203,7 @@ class Channel[Msg] { } /** - receiveWithin for reactors. + * receiveWithin for reactors. */ def reactWithin(msec: long)(f: PartialFunction[Any, Unit]): Nothing = { assert(self == receiver, "react on channel belonging to other actor") diff --git a/src/actors/scala/actors/Reactor.scala b/src/actors/scala/actors/Reactor.scala index d8cb0d0bb5..153220987b 100644 --- a/src/actors/scala/actors/Reactor.scala +++ b/src/actors/scala/actors/Reactor.scala @@ -1,13 +1,23 @@ -package scala.actors +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ -/** - This class provides (together with Channel) an - implementation of event-based actors (aka reactors). +// $Id: $ - The main ideas of our approach are explained in the paper
- Event-Based Programming without Inversion of Control, Philipp Haller, Martin Odersky Proc. JMLC 2006 +package scala.actors - @author Philipp Haller +/** + * This class provides (together with Channel) an + * implementation of event-based actors (aka reactors). + * + * The main ideas of our approach are explained in the paper
+ * Event-Based Programming without Inversion of Control, Philipp Haller, Martin Odersky Proc. JMLC 2006 + * + * @author Philipp Haller */ trait Reactor extends Actor { private var lastSender: Actor = null @@ -20,7 +30,7 @@ trait Reactor extends Actor { private[actors] var continuation: PartialFunction[Any, Unit] = null private[actors] var timeoutPending = false - private[actors] def scheduleActor(f: PartialFunction[Any, Unit], msg: Any) = { + private[actors] def scheduleActor(f: PartialFunction[Any, Unit], msg: Any) = if (f == null && continuation == null) { // do nothing (timeout is handled instead) } @@ -30,7 +40,6 @@ trait Reactor extends Actor { msg) Scheduler.execute(task) } - } private[actors] def defaultDetachActor: PartialFunction[Any, Unit] => Unit = (f: PartialFunction[Any, Unit]) => { @@ -48,15 +57,14 @@ trait Reactor extends Actor { resetActor() /** - Starts this reactor. + * Starts this reactor. */ - def start(): Unit = { + def start(): Unit = Scheduler.execute(new StartTask(this)) - } /** - Terminates this reactor, thereby influencing linked actors - (see Actor.exit). + * Terminates this reactor, thereby influencing linked actors + * (see Actor.exit). */ def exit(reason: String): Unit = { exitReason = reason @@ -65,23 +73,23 @@ trait Reactor extends Actor { } /** - The abstract class Reaction associates an instance - of a Reactor with a - java.lang.Runnable. It is also the super class of - the different kinds of tasks used for the execution of - Reactors. - - @author Philipp Haller + * The abstract class Reaction associates an instance + * of a Reactor with a + * java.lang.Runnable. It is also the super class of + * the different kinds of tasks used for the execution of + * Reactors. + * + * @author Philipp Haller */ private[actors] abstract class Reaction extends Runnable { def actor: Reactor } /** - This class represents task items used to start the execution - of Reactors. - - @author Philipp Haller + * This class represents task items used to start the execution + * of Reactors. + * + * @author Philipp Haller */ private[actors] class StartTask(a: Reactor) extends Reaction { def actor = a @@ -100,15 +108,12 @@ private[actors] class StartTask(a: Reactor) extends Reaction { a.exit("normal") } catch { - case _: InterruptedException => { + case _: InterruptedException => a.exitLinked() - } - case d: SuspendActorException => { + case d: SuspendActorException => // do nothing (continuation is already saved) - } - case t: Throwable => { + case t: Throwable => a.exit(t.toString()) - } } finally { Actor.selfs.put(t, saved) @@ -117,11 +122,11 @@ private[actors] class StartTask(a: Reactor) extends Reaction { } /** - This class represents task items used to execute actions - specified in arguments of react and - reactWithin. - - @author Philipp Haller + * This class represents task items used to execute actions + * specified in arguments of react and + * reactWithin. + * + * @author Philipp Haller */ private[actors] class ActorTask(a: Reactor, f: PartialFunction[Any, Unit], @@ -142,13 +147,12 @@ private[actors] class ActorTask(a: Reactor, a.exit("normal") } catch { - case _: InterruptedException => a.exitLinked() - case d: SuspendActorException => { + case _: InterruptedException => + a.exitLinked() + case d: SuspendActorException => // do nothing (continuation is already saved) - } - case t: Throwable => { + case t: Throwable => a.exit(t.toString()) - } } finally { Actor.selfs.put(t, saved) diff --git a/src/actors/scala/actors/Scheduler.scala b/src/actors/scala/actors/Scheduler.scala index 429437a6c7..57e04fa7cb 100644 --- a/src/actors/scala/actors/Scheduler.scala +++ b/src/actors/scala/actors/Scheduler.scala @@ -1,13 +1,23 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors -import scala.collection.mutable.{Queue,Buffer,ArrayBuffer} +import scala.collection.mutable.{ArrayBuffer, Buffer, Queue} /** - The Scheduler object is used by - Reactor to execute tasks of an execution of a - reactor. - - @author Philipp Haller + * The Scheduler object is used by + * Reactor to execute tasks of an execution of a + * reactor. + * + * @author Philipp Haller */ object Scheduler { private var sched: IScheduler = @@ -22,18 +32,16 @@ object Scheduler { sched.execute(task) } - def tick(a: Reactor) = { - sched.tick(a) - } + def tick(a: Reactor) = sched.tick(a) def shutdown(): Unit = sched.shutdown() } /** - This abstract class provides a common interface for all - schedulers used to execute reactors. - - @author Philipp Haller + * This abstract class provides a common interface for all + * schedulers used to execute reactors. + * + * @author Philipp Haller */ abstract class IScheduler { def execute(task: Reaction): Unit @@ -50,10 +58,10 @@ abstract class IScheduler { } /** - This scheduler executes the tasks of a reactor on a single - thread (the current thread). - - @author Philipp Haller + * This scheduler executes the tasks of a reactor on a single + * thread (the current thread). + * + * @author Philipp Haller */ class SingleThreadedScheduler extends IScheduler { def execute(task: Reaction): Unit = { @@ -69,10 +77,10 @@ class SingleThreadedScheduler extends IScheduler { } /** - This scheduler creates additional threads whenever there is no - idle thread available. - - @author Philipp Haller + * This scheduler creates additional threads whenever there is no + * idle thread available. + * + * @author Philipp Haller */ class SpareWorkerScheduler extends IScheduler { private val tasks = new Queue[Reaction] @@ -82,7 +90,7 @@ class SpareWorkerScheduler extends IScheduler { private var maxWorkers = 2 def init() = { - for (val i <- List.range(0, 2)) { + for (val i <- 0 until 2) { val worker = new WorkerThread(this) workers += worker worker.start() @@ -121,7 +129,7 @@ class SpareWorkerScheduler extends IScheduler { def shutdown(): Unit = synchronized { terminating = true val numNonIdle = workers.length - idle.length - for (val i <- List.range(0, numNonIdle)) + for (val i <- 0 until numNonIdle) tasks += QUIT_TASK val idleThreads = idle.elements while (idleThreads.hasNext) { @@ -133,10 +141,10 @@ class SpareWorkerScheduler extends IScheduler { } /** - This class is used by schedulers to execute reactor tasks on - multiple threads. - - @author Philipp Haller + * This class is used by schedulers to execute reactor tasks on + * multiple threads. + * + * @author Philipp Haller */ class WorkerThread(sched: IScheduler) extends Thread { private var task: Runnable = null @@ -150,9 +158,7 @@ class WorkerThread(sched: IScheduler) extends Thread { override def run(): Unit = synchronized { try { while (running) { - if (task != null) { - task.run() - } + if (task != null) task.run() task = sched.getTask(this) if (task == sched.QUIT_TASK) { running = false diff --git a/src/actors/scala/actors/ThreadedActor.scala b/src/actors/scala/actors/ThreadedActor.scala index 2e3e8ecc2b..3a0f49c82a 100644 --- a/src/actors/scala/actors/ThreadedActor.scala +++ b/src/actors/scala/actors/ThreadedActor.scala @@ -1,3 +1,13 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors /** diff --git a/src/actors/scala/actors/TimerThread.scala b/src/actors/scala/actors/TimerThread.scala index 205789415e..33b24ca74b 100644 --- a/src/actors/scala/actors/TimerThread.scala +++ b/src/actors/scala/actors/TimerThread.scala @@ -1,9 +1,19 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors /** * This class allows the (local) sending of a message to an actor after - * a timeout. Used by the library to build receiveWithin(time: long). - * Note that the library deletes non-received TIMEOUT message if a + * a timeout. Used by the library to build receiveWithin(time: long). + * Note that the library deletes non-received TIMEOUT message if a * message is received before the time-out occurs. * * @author Sebastien Noir diff --git a/src/actors/scala/actors/remote/FreshNameCreator.scala b/src/actors/scala/actors/remote/FreshNameCreator.scala index 2e30c69f1f..f832c23b7e 100644 --- a/src/actors/scala/actors/remote/FreshNameCreator.scala +++ b/src/actors/scala/actors/remote/FreshNameCreator.scala @@ -1,3 +1,13 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors.remote object FreshNameCreator { diff --git a/src/actors/scala/actors/remote/JavaSerializer.scala b/src/actors/scala/actors/remote/JavaSerializer.scala index 94dabc3b47..7dd6f09c25 100644 --- a/src/actors/scala/actors/remote/JavaSerializer.scala +++ b/src/actors/scala/actors/remote/JavaSerializer.scala @@ -1,8 +1,20 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors.remote -import java.io.{ByteArrayInputStream,ByteArrayOutputStream,ObjectInputStream,ObjectOutputStream} +import java.io.{ByteArrayInputStream, ByteArrayOutputStream, + ObjectInputStream, ObjectOutputStream} class JavaSerializer(serv: Service) extends Serializer(serv) { + def serialize(o: AnyRef): Array[Byte] = { val bos = new ByteArrayOutputStream() val out = new ObjectOutputStream(bos) diff --git a/src/actors/scala/actors/remote/NetKernel.scala b/src/actors/scala/actors/remote/NetKernel.scala index 19d6f81f6a..5209ae4069 100644 --- a/src/actors/scala/actors/remote/NetKernel.scala +++ b/src/actors/scala/actors/remote/NetKernel.scala @@ -1,8 +1,16 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors.remote -import java.io.{IOException,StringReader,StringWriter} -import java.net.UnknownHostException -import scala.collection.mutable.{HashMap,HashSet} +import scala.collection.mutable.{HashMap, HashSet} case class NamedSend(senderName: Symbol, receiver: Symbol, data: Array[Byte]) @@ -25,7 +33,8 @@ class NetKernel(service: Service) { register(freshName, Actor.self) freshName } - case Some(name) => name + case Some(name) => + name } namedSend(node, senderName, name, msg) } @@ -40,9 +49,8 @@ class NetKernel(service: Service) { def act() = { a ! msg } override def !(msg: Any): Unit = { msg match { - case refmsg: AnyRef => { + case refmsg: AnyRef => namedSend(senderNode, receiver, senderName, refmsg) - } } } override def !?(msg: Any): Any = @@ -50,7 +58,8 @@ class NetKernel(service: Service) { } senderProxy.start() } - case None => // message is lost + case None => + // message is lost } } } diff --git a/src/actors/scala/actors/remote/Serializer.scala b/src/actors/scala/actors/remote/Serializer.scala index f68fdce263..c4f5dc680e 100644 --- a/src/actors/scala/actors/remote/Serializer.scala +++ b/src/actors/scala/actors/remote/Serializer.scala @@ -1,6 +1,16 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors.remote -import java.io.{DataInputStream,DataOutputStream,EOFException,IOException} +import java.io.{DataInputStream, DataOutputStream, EOFException, IOException} abstract class Serializer(val service: Service) { def serialize(o: AnyRef): Array[byte] diff --git a/src/actors/scala/actors/remote/Service.scala b/src/actors/scala/actors/remote/Service.scala index a9ccb3240c..6b32cd1d84 100644 --- a/src/actors/scala/actors/remote/Service.scala +++ b/src/actors/scala/actors/remote/Service.scala @@ -1,3 +1,13 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors.remote trait Service { diff --git a/src/actors/scala/actors/remote/TcpService.scala b/src/actors/scala/actors/remote/TcpService.scala index 0237cc0e96..715749dd96 100644 --- a/src/actors/scala/actors/remote/TcpService.scala +++ b/src/actors/scala/actors/remote/TcpService.scala @@ -1,8 +1,19 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2005-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: $ + package scala.actors.remote -import java.io.{DataInputStream,DataOutputStream,BufferedReader,PrintWriter, - IOException,InputStreamReader,OutputStreamWriter} -import java.net.{InetAddress,ServerSocket,Socket,UnknownHostException} +import java.io.{BufferedReader, DataInputStream, DataOutputStream, + IOException, InputStreamReader, OutputStreamWriter, + PrintWriter} +import java.net.{InetAddress, ServerSocket, Socket, UnknownHostException} object TcpService { val random = new java.util.Random(System.currentTimeMillis()) -- cgit v1.2.3