The same way that you open one!
In the the client just create two Sockets and connect them both to the server. At the server you will get two accepts, and thus two ServerSockets. Now you can use one pair of sockets for the file xfer and the other pair for chat.
Yes. Provided your server has enough capacity you can have many many clients (each with one or more connections) all communicating at the same time. Each connection just starts a new Thread on the server.
In your server you have a loop that starts with a accept(). When you get an incoming connection the accept returns you a ServerSocket. You then start a new Thread, passing in that ServerSocket, and process all the I/O for that connection in that thread. Your loop then goes back to waiting for another incoming connection.
Server-It ill keep on running to accept the connection...... When it is accept a connection it ill open an frame with chat and send file ....... If a new connection will came it ill again open a frame with chat and send file.....
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"