473,320 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

question: how long would it take

I am doing some research regarding writing a small webserver in java...

So my question is:

How long would it take to write a small webserver in java, by say some
one who has little experience in java but has a strong programming
background ?

Would it be possible to run this from a Windoze CE ?
Any ideas and links greatly appreciated !
Jul 17 '05 #1
2 1596
John Smith wrote:
I am doing some research regarding writing a small webserver in java...

So my question is:

How long would it take to write a small webserver in java, by say some
one who has little experience in java but has a strong programming
background ?

Would it be possible to run this from a Windoze CE ?
Any ideas and links greatly appreciated !

Well depends on what features you want to support. But i see it as
maby, if you don't have the knowledge, as a 50 hr job to have a decent
HTTP 1.1 server going. If you do have experience with parsing and stuff
you might be looking at around 20 hrs...

Thats just my estimate.
Jul 17 '05 #2
As Torsten said, it's pretty simple. Here is a snippet (for illustration
only... you could punch many holes in this :-) It does not parse the
HTTP headers or anything like that, but that's pretty simple.

public class SampleServer
{

public static void main(String[] args)
{
if (args.length != 1)
{
System.err.println(USAGE);
}

int port = -1;

try
{
port = Integer.parseInt(args[0]);
}
catch (NumberFormatException e)
{
System.err.println(USAGE);
System.exit(1);
}

try
{
ServerSocket ss = new ServerSocket(port);
mDispatchThread = new DispatchThread(ss);
mDispatchThread.start();
}
catch (IOException e)
{
DHLLog.getInstance().fatal(SampleServer.class, "error
setting up socket", e);
}
}

static class DispatchThread
extends Thread
{
DispatchThread(ServerSocket ss)
{
mSS = ss;
}

/* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
public void run()
{
Socket s = null;
char[] buffer = new char[1024];

do {
try {
s = mSS.accept();
}
catch (IOException e) {
System.err.println("Error while in accept: " +
e.getMessage());
System.exit(1);
}

// REQUEST: s.getInputStream()
// RESPONSE: s.getOuputStream()
while (true);

}

private boolean mKeepRunning = true;
private ServerSocket mSS;
}

private static final String USAGE = "usage: SampleServer <portNumber>";
}

John Smith wrote:
I am doing some research regarding writing a small webserver in java...

So my question is:

How long would it take to write a small webserver in java, by say some
one who has little experience in java but has a strong programming
background ?

Would it be possible to run this from a Windoze CE ?
Any ideas and links greatly appreciated !


Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: John Timbers | last post by:
I'd like to purchase Visual C# .Net for learning purposes only since it's a lot cheaper than Visual Studio (note that I'm a very experienced C++ developer). Can someone simply clarify the basic...
5
by: lixiaoyao | last post by:
hi all I use matrix & vector function to allocate the space myself in c, typedef struct matrix_array newdata; struct matrix_array{ float **sy,*sxx; }; newdata ndata;//new data struct...
1
by: DiskMan | last post by:
System: Redhat 7.2 Kernel-2.6.11.8 GCC-3.4.3 CCC-6.5.9 Binutils-2.15 Make-3.80 GTK/GLIB-2.6.7 For some reason my Linux box is suddenly having issues trying to read ;
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
13
by: Elijah Bailey | last post by:
I have a long x; I want to write a function long f(long x, int k) such that it extracts every k-th bit of x, concatenates them and returns it. Anyone can help me in writing this function? ...
2
by: John A | last post by:
I have a Web Service that I am reponsible for that we use for data integration purposes. Recently I have been tasked with sending some of this data to a third party. Because they need to receive...
37
by: Prafulla T | last post by:
Assume that an integer pointer x is declared in a "C" program as int *x; Further assume that the location of the pointer is 1000 and it points to an address 2000 where value 500 is stored in 4...
9
by: Bam | last post by:
Hey gang. Question here: If someone registering for the site, enters their GUID. Now a check is made on that GUID across a DB Table to see if the GUID is present. There are approx 57,000...
22
by: Bill Reid | last post by:
I just noticed that my "improved" version of sscanf() doesn't assign floating point numbers properly if the variable assigned to is declared as a "float" rather than a "double". (This never...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.