From e6f5e9e732a2e40aaa63f4fd8b0e5e47c2cd2710 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 16 Jan 2010 21:56:32 +0100 Subject: [PATCH] Actor now uses default contact address for makeRemote --- akka-core/src/main/scala/actor/Actor.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/akka-core/src/main/scala/actor/Actor.scala b/akka-core/src/main/scala/actor/Actor.scala index e40e5e062f..7e038a7509 100644 --- a/akka-core/src/main/scala/actor/Actor.scala +++ b/akka-core/src/main/scala/actor/Actor.scala @@ -12,7 +12,7 @@ import se.scalablesolutions.akka.stm.Transaction._ import se.scalablesolutions.akka.stm.TransactionManagement._ import se.scalablesolutions.akka.stm.{StmException, TransactionManagement} import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest -import se.scalablesolutions.akka.remote.{RemoteProtocolBuilder, RemoteClient, RemoteRequestIdFactory} +import se.scalablesolutions.akka.remote.{RemoteProtocolBuilder,RemoteServer, RemoteClient, RemoteRequestIdFactory} import se.scalablesolutions.akka.serialization.Serializer import se.scalablesolutions.akka.util.{HashCode, Logging, UUID} @@ -633,7 +633,12 @@ trait Actor extends TransactionManagement { */ def makeRemote(address: InetSocketAddress): Unit = if (_isRunning) throw new IllegalStateException("Can't make a running actor remote. Make sure you call 'makeRemote' before 'start'.") - else _remoteAddress = Some(address) + else { + _remoteAddress = Some(address) + if(_contactAddress.isEmpty) + setContactAddress(RemoteServer.HOSTNAME,RemoteServer.PORT) + } + /** * Set the contact address for this actor. This is used for replying to messages sent asynchronously when no reply channel exists.