Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
soldier.mh.2001
project-team-28
Commits
5b05887b
Commit
5b05887b
authored
Jul 16, 2021
by
mohammadmahdihn
Browse files
push konam pull konid
parent
c4199768
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/MainClient.java
View file @
5b05887b
...
...
@@ -8,6 +8,7 @@ import org.view.LoginMenuView;
import
java.io.*
;
import
java.net.Socket
;
import
java.util.ArrayList
;
import
java.util.Scanner
;
public
class
MainClient
{
...
...
@@ -17,7 +18,7 @@ public class MainClient {
public
static
void
initializeNetwork
()
{
try
{
socket
=
new
Socket
(
"localhost"
,
7
6
77
);
socket
=
new
Socket
(
"localhost"
,
7
8
77
);
dataInputStream
=
new
DataInputStream
(
socket
.
getInputStream
());
dataOutputStream
=
new
DataOutputStream
(
socket
.
getOutputStream
());
}
catch
(
IOException
x
)
{
...
...
@@ -27,10 +28,15 @@ public class MainClient {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
initializeNetwork
();
dataOutputStream
.
writeUTF
(
"2"
);
dataOutputStream
.
flush
();
String
result
=
dataInputStream
.
readUTF
();
System
.
out
.
println
(
"4"
);
while
(
true
){
Scanner
scanner
=
new
Scanner
(
System
.
in
);
String
string
=
scanner
.
nextLine
();
dataOutputStream
.
writeUTF
(
string
);
dataOutputStream
.
flush
();
String
result
=
dataInputStream
.
readUTF
();
System
.
out
.
println
(
result
);
}
// restoreDatabase();
// new LoginMenuView().run();
}
...
...
src/main/java/server/MainServer.java
View file @
5b05887b
...
...
@@ -16,7 +16,7 @@ public class MainServer {
public
void
initializeNetwork
()
{
try
{
serverSocket
=
new
ServerSocket
(
7
6
77
);
serverSocket
=
new
ServerSocket
(
7
8
77
);
while
(
true
){
Socket
socket
=
serverSocket
.
accept
();
startNewThread
(
socket
);
...
...
Write
Preview
Supports
Markdown
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