aboutsummaryrefslogtreecommitdiffstats
path: root/src/demo_server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'src/demo_server.rb')
-rwxr-xr-xsrc/demo_server.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/demo_server.rb b/src/demo_server.rb
index a5c49db..e89b69d 100755
--- a/src/demo_server.rb
+++ b/src/demo_server.rb
@@ -27,11 +27,11 @@ Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
# the server to use (pcsc,sim)
@type = "pcsc"
# which IO to use (tcp,unix)
-@socket = "tcp"
+@socket = "unix"
# tcp port
@port = 1337
# unix socket
-@unix = "/tmp/sap.socket"
+@unix = "/tmp/osmocom_sap"
# sim file
@file = "sim.xml"
# the verbosity (from common)
@@ -99,6 +99,10 @@ when "tcp"
socket = TCPServer.new("0.0.0.0",@port)
when "unix"
require 'socket'
+ if File.exists?(@unix)
+ puts 'Previous socket exists, deleting it...'
+ File.delete(@unix)
+ end
socket = UNIXServer.new(@unix)
else
raise "please defined which socket to use"