Skip to content

atillaturkmen/java-web-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-web-server

  • Multihreaded TCP server implemented in Java with java.net package.
  • Every connection is handled in a different thread.
  • The server listens to the client connection and writes incoming data into a file.
  • A binary semaphore is used to prevent data races while writing into the file between threads.

Outputs

Clients

Screenshot (117)

Server

Server logs

/127.0.0.1:49160 opened a connection in thread ServerThread@2e8b50b9
/127.0.0.1:49160 sent: hello
/127.0.0.1:49161 opened a connection in thread ServerThread@26372370
/127.0.0.1:49161 sent: hello
/127.0.0.1:49161 closed the connection.
/127.0.0.1:49160 sent: hello 2
/127.0.0.1:49160 closed the connection.

File output

/127.0.0.1:49160 hello
/127.0.0.1:49161 hello
/127.0.0.1:49160 hello 2

About

Multihreaded TCP server implemented in Java

Resources

Stars

Watchers

Forks

Languages