473,774 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How develop server in java

44 New Member
Hi there,

I am new in java, I was C++ developer.
I have to develop echo server using java which would be run on windows , I am ready with server logic.

I am stuck in basic code of java server as I don't understand how to write code for server start / stop as well run java server as daemon process ( like C++ ).

Is there any thing in java simillar to windows services in C++ ??

Please suggest me, your help will make me happy.

Thank you
Abhinay
Jan 12 '09 #1
5 1801
JosAH
11,448 Recognized Expert MVP
Start reading the API documentation for the ServerSocket class; such an object can accept incoming Sockets, read data from them and write it back again (the 'echo' functionality). Keep accepting sockets on the server socket until you stop the loop.

Running the entire thing as a daemon is beyond the scope of Java; you have to start the JVM as a daemon; its a shell/command line job.

kind regards,

Jos
Jan 12 '09 #2
Abhinay
44 New Member
Thank you very much for your suggestion, if posible can you please give me any idea for running server ( JVM ) as daemon in windows.
Jan 12 '09 #3
JosAH
11,448 Recognized Expert MVP
@Abhinay
I don't know much about windows but type "help start"; the start command starts another command as a background process.

kind regards,

Jos
Jan 12 '09 #4
chaarmann
785 Recognized Expert Contributor
You could run a normal java application that starts a daemon thread:

Expand|Select|Wrap|Line Numbers
  1.  class MyThread extends Thread
  2. {
  3.  MyThread()
  4.  {
  5.   this.setDaemon(true);
  6.  }
  7.  public void run()
  8.  {
  9.    ...
  10.  }
  11. }
  12.  
Jan 13 '09 #5
JosAH
11,448 Recognized Expert MVP
@chaarmann
But that still doesn't run the entire JVM as a daemon process ...

kind regards,

Jos
Jan 13 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
4495
by: JShurmatz | last post by:
If anyone can shed some light on this problem I would greatly appreciate it. I am unsuccessfully trying to use a database connnection retrieved from a pool configured using Java System Web Server 6.1 with the SQL Server 2000 JDBC Driver. The background: 1. I have downloaded the SQL Server 2000 JDBC Driver and installed it on the web server.
0
3680
by: Monica Ferrero | last post by:
Hi! I'm not sure if this is the most adequate mySQL list for this post. If not, please indicat me which one I should use... I'm using Tomcat 4.1.24 with Apache 2 and MySQL 4.0.13. I have the mysql- connector-java-2.0.14-bin.jar in commons/lib. The application runs normally, and usually about once or twice a day I get this exception org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Server configuration denies access to data...
4
2545
by: Jonathan Li | last post by:
I have posted the question before but nobody have given me a solution. I would like to rephrase my requirement and want to hear your advice. We are developing application packages for logistics industry. The plan is to develop two packages, one for daily operation in Client/Server mode. The other is for reporting/enquiry in Browser/Server mode. 1. The server must be Unix When I say 'server' means 1) database server; 2) if possible also...
6
1753
by: DraguVaso | last post by:
Hi, I have a, maybe strange looking, question: Is there any way to obstruct developpers to Develop and or Deploy a newer version of a VB.NET-application? Things should happen like this: - Developpers develop the application - The application is tested, and audited for the final release - The final release is isntalled at the clients - After that: there can not be any other new version of the software
66
3149
by: Prashant | last post by:
There are lot of dicussion on C# is much better than C++. Why there is no language to compute C#. This way we are accepting monopoly of M$. Why there is no group which seriously tring to develop new language better than C#.
43
3425
by: Rob R. Ainscough | last post by:
I realize I'm learning web development and there is a STEEP learning curve, but so far I've had to learn: HTML XML JavaScript ASP.NET using VB.NET ..NET Framework ADO.NET SSL
4
2967
by: Grant | last post by:
Dear All, I have found many systems out there uses Applet to take care of real-time data like market data, is there a way to use .Net to build something similar to that? if there is one, from where I should look into it and start? please advise a Fan of .Net Grant
2
3379
by: shanmukhi | last post by:
Hi, I am using tomcat i got a problem with tomcat 5.0.25 as i specified jdk path during installation of tomcat as C:/j2sdk1.4.2_12/jre i tried by specifying path as C:/java/j2sdk1.4.2_12/jre
3
1657
by: walsug | last post by:
hello, I've just finished an program migration from linux system V IPC to Windows Interprocess communication(include other system calls,of course). Now I have to take effort to re-develop it with JAVA,but it seems that java itself has little to do this,or it has but I don't know.The OS kernel mechanism I used include process,thread,semaphore,mutex,filelock,pipe(or message queue),filemapping(or shared memory),etc. I would be so grateful if...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.