WARNING- THIS SOCKET SERVER WILL CREATE A FILE NAMED TEST.TXT
and will overwrite any file with the same name.
SUPPLIED AS IS.

jlouie 7.96
GUIServer.java A Java Socket Server Application that reads and writes to a file.
Client.java    A Java Client Applet that reads and writes to a socket server.       
Index.htm      HTML file that loads the Client Applet
Read_Me.txt    This file.

GUIServ.zip:

This zip archive contains source  code for a GUI Socket Server application
and an client applet.  I wrote this to demonstrate that an applet can
read and write to a file on the originating applet host server.
Place the files .java in c:\java\bin\src.
Place the file Index.htm into the "HTML" folder of the web server.
Place the file Test.txt into c:\java\bin.  

This is beta source code for your perusal.  As far as I
can tell this code works properly under Win95, compiles with Sun's JDK 1.02 and
can be browsed with Netscape 2.01 Win95.  I have tested the Socket Server 
and Client applet using FolkWeb server v1.01 over an ethernet HP NetServerLC
network.  I have also tested the Socket Server using Telnet.  This code does not
work properly with the Mac JDK, Mac NCSA Telnet or Netscape 3.0b4 Mac :(.  Java
does not work with the 16 bit version of Netscape.

Compile the Socket Server with javac eg.
c:\java\bin>javac -d . .\src\GUIServer.java
where the source code is in c:\java\bin\src
and the compiled code is in c:\java\bin
Run the Socket Server from the DOS prompt eg.
c:\java\bin>java GUIServer

Compile the Client applet with javac eg.
c:\java\bin>javac -d c:/MyWebServer/HTML .\src\Client.java
where the source code is in c:\java\bin\src
and the code compiles to c:\MyWebServer\HTML
note the use of UNIX / and DOS \
Call the Client applet using the Index.htm page.

There are a number of ways to test this code LOCALLY once you have installed
the TCP/IP protocol and assigned the HOST an address eg. 192.0.0.5 subnet 255.255.255.0:

1) Run the socket server, create a second DOS window and run Telnet eg.
c:\java\bin>java GUIServer
c:\windows>Telnet 127.0.0.1 8189
where the IP address 127.0.0.1 is the "local loopback" test loop and 8189 is the port.

2) Run the socket server and open the Index.htm file with Netscape.
Open another web browser from the file menu to create two connections.
Open a third web browser and read the error message.

3) Run the socket server, a web server, the client applet and Netscape simultaneously.
and http to http:\\127.0.0.1
Open another web browser from the file menu to create two connections.
Open a third web browser and read the error message.

One can test this code over an ethernet NETWORK using Netscape or Telnet eg.
c:\windows>Telnet MY.WEBSERVER.IP.ADDRESS 8189
or Netscape 2.01 http\\MY.WEBSERVER.IP.ADDRESS

Comments to: 73270.1776@compuserve.com 
