Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Technology & Software 2 years ago
Posted on 16 Aug 2022, this text provides information on Technology & Software related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I've a task here and I am unable to finalize and not sure what technology opt my problem. Here is the explanation of my problem. My application is stand alone application and will deploy in different locations. Lets say LocA, LocB and so on. Each location has its own clients some clients are connected via LAN and some are third party clients. As long as if the clients are connected via LAN no problem of requesting and response. But there will be few clients which are not connected via LAN.
To the third party clients we will provide IP and PORT to connect and request for data in a standard HL7 format. The problem here is the clients can create their own client program by using any technology. They may use Socket programming, .NET socket programming and so on. But our server should accept connections from clients what ever the technology it is, process their requests and respond back to them. And the requirement is the server program should run always and listens to the allotted ports or whenever there is a request to specific port then start our server program and process the client request and respond back to client.
Please pardon me if my English confuses you. Please give me a solution for my problem.
Note : Client program can be any technology and any programming language. That is up to client which way they want to use to connect with server and send their requests.
I am giving a small example here, that how client and server works with Socket, i am also including the multithreading on the Server side.
Client side code:
public class ClientWala { public static void main(String[] args) throws Exception{ Boolean b = true; Socket s = new Socket("127.0.0.1", 4444); System.out.println("connected: "+s.isConnected()); OutputStream output = s.getOutputStream(); PrintWriter pw = new PrintWriter(output,true); // to write data to server while(b){ if (!b){ System.exit(0); } else { pw.write(new Scanner(System.in).nextLine()); } } // to read data from server InputStream input = s.getInputStream(); InputStreamReader isr = new InputStreamReader(input); BufferedReader br = new BufferedReader(isr); String data = null; while ((data = br.readLine())!=null){ // Print it using sysout, or do whatever you want with the incoming data from server } } }
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.