Showing posts with label Webservices And Server side .... Show all posts
Showing posts with label Webservices And Server side .... Show all posts

Tuesday, June 15, 2010

Multi client - server program

For an interview process, i was asked to write a simple chat server server( socket programming) which handles multiple clients and it should broadcast a client msg to all other clients who connected to the server at that instance. And the client side chat window should be designed in QT.

The code is attached to the following link.

Server side program;
http://www.4shared.com/file/2h1hTx02/server.htm

Client side program.

http://www.4shared.com/file/GgSwBbys/client.html

Steps for compiling and checking the demo:
----------------------------------------------

pre requiste : qt4.3-dev tools , or qt libraries need to be installed.

Step1 : Un install the server.zip into a folder. (name: server )

> qmake -project
> qmake
> make

> ./server 50003 ---> Example to run the server.

Step 2: Un install the client.zip into a folder.( named: client )

> qmake -project
> qmake
> make

>./client mani 50003 ---> Example to run the client.

As soon as you give the above command, a qt based chat window will open on which you can type your chat messages.

Parallely open 3,4 terminals and instantiate the client program with different names, so that you will see similar chat windows opened.

On each you can type messages, which will be broadcasted to others.
I have tried it on ubuntu.

Snapshot:

client-chat-window:



client-multiple-windows:

Sunday, March 7, 2010

Microsoft's Cloud services like the Google's appengine !!

Google's appengine is used to crete application and services in clouds.. So as Microsoft !!!
It is called Azure platform .. If you are comfortable with .net or any MS technology Azure could be a guide to put your imagination into clouds :)



Sunday, February 14, 2010

Open Directory Project and Yahoo Directory

Get Listed in Google Search

Submit Your Site To The Yahoo! Directory & The Open Directory Project Index

One of the methods to get listed in google search is to submit your web site to the Yahoo! Directory  and/or Open Directory Project index, which is owned by Netscape.

As Google has agreements with Yahoo! and Netscape to include the sites indexed in their directories in the Google index,this seems to be a good method of getting into the Google index. 

Visit Yahoo!'s http://docs.yahoo.com/info/suggest/  page

Open Directory Project's http://www.dmoz.org/ page.

Once your site is included in either of these directories,ODP say it will take 1 to 2 months 

to get listed in Google index.

Become an Editor: You can also volunteer in ODP(www.dmoz.org) to become

an Editor who helps them in building their directory index.

For more check Become an Editor Section in dmoz.org.

I have applied for Tamil language category to become an Editor.


Best Regards,

K.Rajasekaran






Wednesday, January 27, 2010

Thursday, January 21, 2010

Steps for linking appspot to your domain name.

Me and my friend Senthil, have tried creating a domain name and linked it with google appspot. Below is the consolidation of the steps.

1)Go to godaddy.com and choose a domain name of your choice, pay and buy it.
2)Once you have bought u will have a new entry in your

3)You have a app created using google app engine and you have deployed it and running successfully. Now that you wanna link the appspot to a domain name of your choice which u created in godaddy. Lets c how do we do this step by step.

4)First step is go to www.google.com/a.

5)Click standard edition and add a domain you have created. Follow the steps.

6)YOU will be asked to verify your domain by adding randomly generated string into the CNAME record for your domain DNS. ( this step you have to do in goDaddy.com against your domain DNS)
ex... googlefffggghhh12345 (your unique string)
Once u have verified your domain. Next step is to add it in appengine.

7) Go to appengine.google.com. Click the application id you wanted to link with domain.

8) Administration->Application Settings-> Add domain
Give the domain name.

*Note If you have not added your domain in google apps, step 8 will not work.

9) Now go to www.google.com/a/yourdomain.com. In dashboard you will see a new entry added which is nothing but the application id for which you have selected to link with domain.

10 ) Click on the application id and click Add URL , give the 'www' and click add.
Once succesfully added.

11) Go to goDaddy.com then in the CNAME record a edit the entry 'www' to point to 'ghs.google.com'.

12) Now enter 'www.yourdomain.com' in browser it will be directed to your appspot.
SUCESS.

For ref follow the below links.

http://stackoverflow.com/questions/817809/how-to-use-google-app-engine-with-my-own-domain-not-subdomain


http://www.google.com/support/a/bin/answer.py?hl=en&answer=47283


If any step unclear plss give a comment we will help with whatever we know.

Friday, January 8, 2010

Tutorial to use eclipse with Apache tomcat

This tutorial talks about step by step approach of how to use tomcat with Eclipse, setup, and basic servlet execution examples.

http://www.windofkeltia.com/j2ee/wtp-tutorial.html

Wednesday, January 6, 2010

What is Apache & Tomcat.

As a naive to server side development works, i was very confused about two words Apache server & Tomcat server. I was thinking Apache Tomcat is a single acroynm for Server deployment. But there lies the difference if some one says Apacher server and Tomcat or Apache Tomcat server.

Many of you might be aware of these distinctions, but for starters like me thought it could be useful.

ASF is Apache software Foundation, which was formed in 1994, when a group of talened ppl launched a HTTP server written in C language to promote or ease the server side developement of web.

It was named 'Apache HTTP Server'. If somebody says their webserver is running over Apache it means, they use Apache HTTP Server as the core part for HTTP transactions, and on top of the http server webserver logic would have been written to serve some requests ( or provide some service ).

Sun Micro System had their own Java webserver which is also nothing but a HTTP server written in Java language. And over the period of server side development Sun released Java Servlet API to handle multiple request coming to a HTTP server and much more features were provided for server side development ( 1994).

In 1997 , a developer from SUN developed 'Tomcat' as Servlet container which used JAVA HTTP server for http transactions. And later Sun donated Tomcat to make it as Open free software and the Webserver was then called as 'Apache Tomcat'.

So the main difference comes is, Tomcat is a pure Java based HTTP web server for Java code to run ( which is noting but Java Servlets & JSP ).
Where as Apache HTTP server is HTTP server written in c to support server development in C.

You cannot deploy a webapplication written in Java ( JSP, Servlet ) and deploy it in different webserver which is not compatible with JSP & Servlet. And similary you cannot develop a webapp in C or CGI and try to deploy in Tomcat webserver which in purely Java based.

Since Java & Tomcat is open source and freely available to every one, most of the server side hosting is done using Tomcat webserver. And it is available for all platforms Linux,WIndows,MAC os, UNIX,Solaris & many more...

This way, ASF has given many open source products which is making the server side development for WWW more easier and faster.

Wiki Links:


http://en.wikipedia.org/wiki/Apache_HTTP_Server


http://en.wikipedia.org/wiki/Apache_Tomcat

Tuesday, January 5, 2010

How to write a tiny webserver in Java.

Guys.. this link tells an easier way of writing a tiny webserver which will listen on port 80 and fetch you a index.html when GET operation is performed.

I understood at the first go. thought it would be useful to share with u all.

http://fragments.turtlemeat.com/javawebserver.php

And i checked the example code it works fine. Try it.
Good work by Jon Berg. ( author )

HTTP protocol in a simpler way.

Hello all..


Found this link pretty useful for HTTP protocol definitions and understandings. Before u put HTTP in ur resume, make sure you go through this link once :)

http://www.jmarshall.com/easy/http/

Monday, December 14, 2009

Step by step approach of deploying a webapp in Eclipse.

Hello all,

I was facing many issues in bringing up a small webapp using eclipse & tomcat. I couldnt succeed.
But then i followed the step by step steps given in the java tips site and were able to deploy a successfull sample web-app.

- came to know about basics of JSP,Servlets and webapp and how it is deployed in tomcat. Please go through it if u r a started & interested in delpoying a webapp


http://www.java-tips.org/index.php?Itemid=99&id=1507&option=com_content&task=view&mosmsg=Thanks+for+your+vote!

Wednesday, December 9, 2009

Apache Tomcat Vs Apache web server

Apache Tomcat Vs Apache Web Server
sometime back i setup tortoise SVN and i used apache server for network access to repository ..i had options for http,https etc.
yesterday I saw mani ans senthil setting up Apache TOMCAT. Me and Mani were wondering what is tomcat and what is apache web server...

Here is an excerpt from Wikipedia about apache Tomcat and Apache web server

Apache Tomcat (or Jakarta Tomcat or simply Tomcat) is a servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a "pure Java" HTTP web server environment for Java code to run.

Tomcat should not be confused with the Apache web server, which is a C implementation of an HTTP web server; these two web servers are not bundled together. Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files
Members of the ASF and independent volunteers develop and maintain Tomcat. Users have free access to the source code and to the binary form of Tomcat under the Apache License. The initial Tomcat release appeared with versions 3.0.x (previous releases were Sun internal releases, and were not publicly released). Tomcat 6.0.20 is the latest production quality release of the 6.0.x trunk (the branch for the 2.5 servlet specification), as of 2009.

Components of Tomcat

Tomcat version 4.x was released with Jasper (a redesigned JSP engine), Catalina (a redesigned servlet container) and Coyote (an HTTP connector).
[edit] Catalina

Catalina is Tomcat's servlet container. Catalina implements Sun Microsystems' specifications for servlet and JavaServer Pages (JSP). The architect for Catalina was Craig McClanahan.
[edit] Coyote

Coyote is Tomcat's HTTP Connector component that supports the HTTP 1.1 protocol for the web server or application container. Coyote listens for incoming connections on a specific TCP port on the server and forwards the request to the Tomcat Engine to process the request and send back a response to the requesting client.
[edit] Jasper

Jasper is Tomcat's JSP Engine. Tomcat 5.x uses Jasper 2, which is an implementation of the Sun Microsystems's JavaServer Pages 2.0 specification. Jasper parses JSP files to compile them into Java code as servlets (that can be handled by Catalina). At runtime, Jasper is able to automatically detect JSP file changes and recompile them.
[edit] Jasper 2

From Jasper to Jasper 2, important features were added:

* JSP Tag library pooling - Each tag markup in JSP file is handled by a tag handler class. Tag handler class objects can be pooled and reused in the whole JSP servlet.
* Background JSP compilation - While recompiling modified JSP Java code, the older version is still available for server requests. The older JSP servlet is deleted once the new JSP servlet has been recompiled.
* Recompile JSP when included page changes - Pages can be inserted and included into a JSP at compile time. The JSP will not only be automatically recompiled with JSP file changes but also with included page changes.
* JDT Java compiler - Jasper 2 can use the Eclipse JDT Java compiler instead of Ant and javac.

Best regards
K.Rajasekaran

Friday, November 13, 2009