Solved

NETWORKING USING APPLETS

Posted on 2000-02-25
6
241 Views
Last Modified: 2013-11-24
hello friends

my question is how do i do the socket connections between a client side & server side using applets??

actually this is used for chat coding.

can i get a code for that for ref.
0
Comment
Question by:s_butala
  • 3
  • 2
6 Comments
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2557464
From: Jod        Date: Wednesday, November 17 1999 - 10:37AM CST       

Some IRC (java) clients that are free - with source code:
http://indiglo.sut.ac.th/java/ChatServer
http://www.chrisknight.com/sirc/  
http://www.javalobby.org/jfa/projects/IRCClient.html  
Working clients (no source):  
http://heaven.riednet.wh.tu-darmstadt.de/apirc/  
http://www.racersdirect.com/RDRN/javairc/IRC.HTM
http://www.rdrop.com/~rubin/jirc/  
http://orion.millenia.org/JAVirc/irc.html   http://www.boomersdomain.com/cgi_bin/help/irc.htm
(working versions you could download and decompile or just use for testing...)      


http://members.tripod.com/~jcode/UtilitiesChat.html

All these are chat code in java applets.

U will get good handle
0
 
LVL 7

Expert Comment

by:vladi21
ID: 2557520
more Info:

look
java how-to IO part 1
http://tactika.com/realhome/javaht/java-f1.html

better use HTTP
Reads From A URL : example
http://www.mindspring.com/~david.dagon/applets/ReadsFromURL.html

HTTP Trace Applet
http://www.idssoftware.com/demos/trace.html

Firewall Access in Java Applets
http://www.idssoftware.com/fwapplet.html


Working with a Server-Side Application
http://java.sun.com/docs/books/tutorial/applet/practical/server.html

Using a Server to Work Around Security Restrictions
http://java.sun.com/docs/books/tutorial/applet/practical/workaround.html

Frequently Asked Questions - Java Security
http://java.sun.com/sfaq/
What Applets Can and Can't Do
http://java.sun.com/docs/books/tutorial/applet/overview/security.html
Security Restrictions
http://java.sun.com/docs/books/tutorial/applet/practical/security.html

Creating Signed, Persistent Java Applets
http://www.ddj.com/articles/1999/9902/9902h/9902h.htm

CGI at server side

Netscape FAQ:
How do I access Servlets or CGI programs from Java?
Using the QUERY method (i.e. the calling parameters are encoded in the URL), it is quite easy:
         URLConnection connect ( new URL("http:\\me\mycgi.sh") ).getConnection();
         PrintStream ps = new PrintStream(connect.getOutputStream());
         connection.setdoOutput(true);    // defaults to false
         ps.print(myPostData);
         ps.close();             // very important to close before reading
         InputStream is = new PrintStream(connect.getInputStream());
         // read the results

Note: URLConnection() is an abstract class whose sub-class is usually supplied by the environment (browser).
Some browsers allow output without calling "doOutput(true)", which violates the Java spec and may be confusing
when code works one place and not another.

POST:
http://www.javaworld.com/javatips/jw-javatip34.html
http://www.javaworld.com/javatips/jw-javatip41.html
---
http://tactika.com/realhome/javaht/java-n1.html#n4
Talk to a CGI/Servlet

U can use servlet at server side

What are servlets?

  Servlets are server-side Java applications, as opposed to
  client-side applets or standalone applications. While
  servlets are compatible with many different types of servers,
  typically they are used in web servers, as a replacement for
  CGI scripts or Active-Server Pages (ASP).

  Java servlets offer many advantages over other forms of
  server-side processing. Apart from the obvious (they are
  written in the Java programming language, a big plus after
  all), servlet based applications are far easier to write
  than CGI scripts. There's no need to write code for parsing
  HTTP request parameters, as this code is provided by the
  javax.servlet.http package. You have access to the entire
  Java API, with no networking restrictions (making servlets
  far more attractive than applets). There are also performance
  increases over CGI scripts, as servlets persist over time,
  and do not create a new process for every connection.

http://www.as400.ibm.com/developer/java/documents/servlet1.html


Purple Servlet FAQ  http://www.purpletech.com/java/servlet-faq/
http://www.newatlanta.com/servlets/servlet-faq.html
http://www.dmoz.org/Computers/Programming/Languages/Java/Runtime_Environments/Servlets/faq.html

The Servlet home page on the Javasoft website
http://java.sun.com/products/java-server/servlets/
http://www.coolservlets.com/

Servlet Essentials by Stefan Zeiger
http://www.novocode.com/doc/servlet-essentials/

Paul Flavin's Servlet Resources page
http://www.frontiernet.net/~imaging/servlets_intro.html
http://oop.rosweb.ru/cetus/oo_java_servlets.html
http://dmoz.org/Computers/Programming/Languages/Java/Runtime_Environments/Servlets/


Applet and Servlet Communication
http://www.j-nine.com/pubs/applet2servlet/Applet2Servlet.html
http://developer.java.sun.com/developer/qow/archive/53/index.html

How can my applet communicate with my servlet?
It's pretty straightforward. You can use the java.net.URLConnection and java.net.URL classes to open a standard HTTP connection to the web server. The server then passes this information to the servlet in the normal way. Basically, the applet pretends to be a web browser, and the servlet doesn't know the difference. (Of course, you can write a servlet that is only called from your applet, in which case it *does* know the difference...)

For more detail, you can see the Sun Web Server FAQ Questions C8 and C9. Also, Chad Darby has an article with source code on the subject. And Netscape DevEdge Online has a similar article - Applet-to-Servlet Communication for Enterprise Applications skip to the "Communication Tactics" section to get to the good part.

Applet-to-Servlet Communication for Enterprise Applications
http://developer.netscape.com/viewsource/fields_servlet/fields_servlet.html


0
 

Author Comment

by:s_butala
ID: 2557522
dear ravindra

the sites which u have mentioned does'not contain the chat code.
can u cut paste for me?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 7

Expert Comment

by:Ravindra76
ID: 2557557
ravindra76 changed the proposed answer to a comment
0
 

Author Comment

by:s_butala
ID: 2557604
dear ravidra
where are the comments??
0
 
LVL 7

Accepted Solution

by:
Ravindra76 earned 50 total points
ID: 2557655
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Java virtual machine monitoring tools 3 40
scoresSpecial  challenge 13 42
count7 challenge 12 70
listing all functions in JavaScript 19 114
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now