Hi,

So i got pretty far whit Java i covered basic operation, GUI w/e MVC design etc. It been a fun year learning Java. Now i want to make an application for communication between two
points similar to a TFTP Server/Client.

So this is how i visioned this to go: I would have 2 classes where:
~ 1 would serve as Server
~ 1 would serve as Client

Server class would be running constantly and would contain the ip of the pc that
contains the class file and would listen and wait until Client class would be started. Once
Client class would be started Server would transfer the file from his pc to client pc.

So far i dont know yet what Java tools come in to play here what should i look at are there any tutorials or similar.

Thanks in advance.

The two key classes you will need are ServerSocket and Socket (short for "client socket").
You create a ServerSocket on your server. It listens for incoming requests on a chosen port.
You create a Socket at the client that connects to the server. The ServerSocket accepts the connection and gives you another Socket that represents the server end of the connection.
Now both the client and the server have their own Socket, and those two Sockets are connected. Each Socket has an input stream and an output stream. You can use those streams to send & receive data across the connection.

Hopefully that's enough info for you to know what to look for on the web.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.