Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IoT Server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jonathan.poalses
IoT Server
Commits
bb55e9d7
Commit
bb55e9d7
authored
Jan 12, 2023
by
Jonathan Poalses
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated gradle and java version, changed to using executor service, added git ignore
parent
bdc81554
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
21 deletions
+85
-21
.gitignore
.gitignore
+64
-0
gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+1
-1
Server.java
src/main/java/jonathan/poalses/Server.java
+20
-20
No files found.
.gitignore
0 → 100644
View file @
bb55e9d7
### Leiningen ###
/.lein-*
/.nrepl-port
/.prepl-port
### IntelliJ IDEA ###
*.iml
*.ipr
modules.xml
.idea/
cmake-build-*/
*.iws
out/
.idea_modules/
atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Java ###
*.class
*.log
*.ctxt
.mtj.tmp/
*.jar
!gradle-wrapper.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
### Mercurial ###
.hgignore
.hg/
### VSCode/Calva ###
.calva/
.clj-kondo/
.lsp/
### Misc ###
/target
/classes
/checkouts
profiles.clj
pom.xml
pom.xml.asc
# Ignore Gradle project-specific cache directory
.gradle
# Ignore Gradle build output directory
build
/local/*.hprof
gradle/wrapper/gradle-wrapper.properties
View file @
bb55e9d7
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-7.
5.1
-bin.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-7.
6
-bin.zip
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
src/main/java/jonathan/poalses/Server.java
View file @
bb55e9d7
...
...
@@ -4,6 +4,7 @@ package jonathan.poalses;
import
java.io.*
;
import
java.net.*
;
import
java.util.concurrent.Executors
;
// Server class
public
class
Server
{
...
...
@@ -16,6 +17,7 @@ public class Server {
}
private
static
void
handle
(
ServerSocket
serverSocket
)
throws
IOException
{
try
(
var
executor
=
Executors
.
newCachedThreadPool
())
{
while
(
true
)
{
Socket
socket
=
null
;
...
...
@@ -32,11 +34,8 @@ public class Server {
System
.
out
.
println
(
"Assigning new thread for this client"
);
outputStream
.
writeUTF
(
"{Server} Connection Successful\n"
);
// create a new thread object
Thread
thread
=
new
Thread
(
new
ServerThread
(
socket
,
inputStream
,
outputStream
));
// Invoking the start() method
thread
.
start
();
// Create a server thread
executor
.
submit
(
new
ServerThread
(
socket
,
inputStream
,
outputStream
));
}
catch
(
Exception
e
)
{
if
(
socket
!=
null
)
{
...
...
@@ -46,5 +45,6 @@ public class Server {
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment