Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97877317
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
Tue, Jan 7, 02:19
Size
908 B
Mime Type
text/x-c
Expires
Thu, Jan 9, 02:19 (2 d)
Engine
blob
Format
Raw Data
Handle
23425371
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
);
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