Skip to content

Commit

Permalink
fixed small bug in scala example
Browse files Browse the repository at this point in the history
  • Loading branch information
mbknor committed May 22, 2011
1 parent 0a66e99 commit 573b46f
Showing 1 changed file with 14 additions and 8 deletions.
Expand Up @@ -54,16 +54,22 @@ object DdslServiceProvider{
val out = new BufferedWriter( new OutputStreamWriter(s.getOutputStream ) )
val in = new BufferedReader( new InputStreamReader( s.getInputStream))

while( true ){
var continue = true
while( continue ){
//wait for command from client
val command = in.readLine
println("Received: " + command)

//send greeting
val msg = "Hello from server at port " + port + " ("+System.currentTimeMillis+")"
println("Sending: " + msg)
out.write(msg + "\n");
out.flush
if (command == null) {
s.close();
continue = false
} else {
println("Received: " + command)

//send greeting
val msg = "Hello from server at port " + port + " ("+System.currentTimeMillis+")"
println("Sending: " + msg)
out.write(msg + "\n");
out.flush
}
}
}catch{
case _ => println("Lost connection")
Expand Down

0 comments on commit 573b46f

Please sign in to comment.