Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97868422
ServerWebService.java
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 6, 23:35
Size
1012 B
Mime Type
text/x-c
Expires
Wed, Jan 8, 23:35 (2 d)
Engine
blob
Format
Raw Data
Handle
23423787
Attached To
R3229 Genome Privacy - SHCS App
ServerWebService.java
View Options
import
java.io.IOException
;
import
java.net.ServerSocket
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
utils.ServerProperties
;
import
framework.WorkerStandalone
;
public
class
ServerWebService
{
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
ServerWebService
.
class
.
getName
());
public
static
void
main
(
String
[]
args
)
{
ServerProperties
props
=
new
ServerProperties
(
"config/config_server.fry.properties"
);
ServerSocket
ss
=
null
;
int
port
=
props
.
getPortServer
();
try
{
ss
=
new
ServerSocket
(
port
);
}
catch
(
IOException
e
){
LOGGER
.
log
(
Level
.
SEVERE
,
"Cannot listen on port "
+
port
,
e
);
try
{
ss
.
close
();
}
catch
(
IOException
e1
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
null
,
e1
);
}
System
.
exit
(-
1
);
}
while
(
true
){
WorkerStandalone
w
;
try
{
w
=
new
WorkerStandalone
(
props
,
ss
.
accept
());
Thread
t
=
new
Thread
(
w
);
t
.
start
();
}
catch
(
IOException
e
){
LOGGER
.
log
(
Level
.
SEVERE
,
"Error in server accept"
,
e
);
}
}
}
}
Event Timeline
Log In to Comment