Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DStore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pr1n19
DStore
Commits
43fbec0e
Commit
43fbec0e
authored
3 years ago
by
pr1n19
Browse files
Options
Downloads
Patches
Plain Diff
Structure for all requirements laid out
parent
52245e0d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/DStore.java
+55
-0
55 additions, 0 deletions
src/DStore.java
with
55 additions
and
0 deletions
src/DStore.java
+
55
−
0
View file @
43fbec0e
import
java.net.ServerSocket
;
import
java.net.Socket
;
public
class
DStore
{
private
static
String
fileFolder
;
private
static
int
timeout
;
public
static
void
main
(
String
[]
args
)
{
//Take arguments from command line
int
port
=
Integer
.
parseInt
(
args
[
0
]);
int
cPort
=
Integer
.
parseInt
(
args
[
1
]);
timeout
=
Integer
.
parseInt
(
args
[
2
]);
fileFolder
=
args
[
3
];
//Make connection with controller & listen to send acknowledgments
//Create socket to listen for store, load & remove requests
try
{
//Create server socket to listen for
ServerSocket
ss
=
new
ServerSocket
(
port
);
//
for
(;;){
try
{
Socket
client
=
ss
.
accept
();
}
catch
(
Exception
e
){
System
.
out
.
println
(
"error "
+
e
);
}
}
}
catch
(
Exception
e
){
System
.
out
.
println
(
"error "
+
e
);
}
}
private
static
void
storeFile
(
String
fileName
)
{
}
private
static
void
loadFile
(
String
fileName
)
{
}
private
static
void
removeFile
(
String
fileName
)
{
}
private
static
void
sendError
()
{
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment