r/learnjava • • 17d ago

Create a local server

I'm working on a client-server project for college, and I have an intermediate level of Java knowledge. I'd like to know what I need to learn to create this server. I wouldn't want to using AI to do all this, just to clear up any doubts. Is there any documentation for this, websites, YouTube channels that you recommend?

12 Upvotes

11 comments sorted by

View all comments

2

u/[deleted] 16d ago

[removed] — view removed comment

1

u/One_Butterfly7169 16d ago

This is a program for the subject of algorithm complexity, so since ServerSketch only works with one client and there will be several, do I have to do it using threads?

1

u/istarian 16d ago

For a start you can read the Java documentation for the relevant classes:

https://docs.oracle.com/javase/8/docs/api/java/net/ServerSocket.html

https://docs.oracle.com/javase/8/docs/api/java/net/Socket.html

^ these are for Java 8, but you can consult the version of this document that applies to whatever version of Java/JDK you happen to be using

https://cs.lmu.edu/~ray/notes/javanetexamples/ ^ here are some examples of how you would use them.