Skip to content

Instantly share code, notes, and snippets.

@longcao longcao/Client.scala
Last active Dec 31, 2015

What would you like to do?
Client source code.
object Client extends App {
val system = ActorSystem("clientSystem")
val clientActor = system.actorOf(Props(new ClientActor), name = "ClientActor")
clientActor ! SayHello
class ClientActor extends Actor {
private val server = context.actorSelection("akka.tcp://serverSystem@")
def receive = {
case SayHello => server ! "Hello."
case message: String => println("Client received reply: " + message)
case _ => println("I got something I didn't understand.")
case object SayHello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.