Closed Thread Icon

Preserved Topic: Java Server Output (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=21149" title="Pages that link to Preserved Topic: Java Server Output (Page 1 of 1)" rel="nofollow" >Preserved Topic: Java Server Output <span class="small">(Page 1 of 1)</span>\

 
WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 03-29-2002 00:05

I have the following code:

code:
import java.io.*;
import java.net.*;

public class JavaServer
{
public static final int PORT = 80;

public static void main(String[] args)
{

try
{
ServerSocket s = new ServerSocket(PORT);
System.out.println("Server Started");

while (true)
{
Socket socket = s.accept();
System.out.println("Connection Logged!");
PrintWriter out = new PrintWriter(
new BufferedWriter(
new OutputStreamWriter(
socket.getOutputStream())),true);
out.println("<html>\n<head>\n\t<title>SomeTitle</title>
\n</head>\n<body>\n\t<p>Some Text</p>\n</body>\n</html>");
}
}
catch (IOException e)
{
System.exit(0);
}
}
}



What I am try to have happen here is that a browser hits the computer running this applet from this hit I would return the string of HTML to the browser so it will be displayed.

I am trying to keep it pretty simple, not too many buffers or anything. I am just trying to get the basic code for this portion so I can expand upon it.

I have been looking at the jigsaw code but I can't really find the core processing.

Anyone have any ideas?

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 03-29-2002 10:51

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 03-29-2002 11:07

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 03-29-2002 11:14

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 03-29-2002 23:46

Thanks for the links! The one to sun's 300 line web server is really cool. I think I can use that to figure out how to code a little web server going. Should be nice.

Thanks!

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 03-29-2002 23:50

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

« BackwardsOnwards »

Show Forum Drop Down Menu