Monday, July 26, 2004

Chat server and client in Java

Over the weekend I wrote a chat server and client.
It is essentially xml over http.
No auth , no message timeouts - just a very simple server : essentially an implict trust is assumed.
Ofcourse , the code is been given out - so you can change it !
The server needs to be hosted publically - so that clients (which can be behind a firewall) can connect to the server (direct or via a http proxy : both supported).

The necessity was that one of my friends was not able to chat with his girl friend 'cos her company was blocking all popular chat servers.
He has direct net conn (with a dhcp public ip) , while she goes through the company proxy to reach the web.
Essentially this is currently a one-off solution for his requirement :)

When he mentioned his problem , it got me thinking on how it is so easy to deny service to users without disrupting their normal net access.
Admin just needs to block a particular host (and its various ip's) and port and voila ! that service gets disabled (in this case chat).
It is this predictability of the server that enables this kind of behaviour - same for napster , kazaa , and the like.
Hence need of the hour is some kind of distributed server without a visibly evident server-set (which can get blocked) 
Last week (same day friend told me of this) , I had discussion of such a generic peer-to-peer communication protocol with Alok over lunch.
After that lunch , got into a discussion with Rajesh and Noble  and we came up with a basic idea and design of how such a fault tolerent distributed network would be , how to manage the various aspects of it , etc.

Both of them consider that this is quiet a normal engineering solution to a given problem - but I feel that this can be extended to domains that are not just restricted to basic user communication (example - gnutella protocol becomes a small subset of this from what i understand of gnutella).
Right now , the idea is to create such a fault tolerent , distributed server-set to which arbitrary clients can connect to and make a reference implementation for chat using the code I will be putting out .... Note - I am good at dreaming :) So none of this might bear fruit !

I will be putting up a link to the code ...  Have not written a build.xml (lazy me :) ) - was relying on the IDE to take care of building ... ofcourse this is not a proper solution when I plan to give out the source !
Will be adding a build.xml and then releasing the code ... tommorrow (I am bad at build scripts ... so will need someone-else help - must bug Noble :) ) !

Note : the XmlWriter in the source tree does not take care of encoding the xml data properly - hence any xml tag like messages will make the server break and reject that message :) - ofcourse , this will be fixed in a later release - not tommorrow's one though ...

--------------


Removed the xml limitations mentioned above :
The source is available here : http://www.geocities.com/mridulm80/chat.html
Have fun !! And please feel free to give feedback

0 Comments:

Post a Comment

<< Home

Thursday, July 22, 2004

GNUChess 6

Added a new blog for tracking my work on this .... URL is http://gnuchess6.blogspot.com
Might be making a 'release' this weekend or the next - will keep you updated in that blog :)

0 Comments:

Post a Comment

<< Home

Wednesday, July 14, 2004

Food Poisoning

Last thursday (8th July) , went to meet guru , chimpu and anjali at Lakeview. After that, met Alok for dinner at Earthern Oven and then went for a late coffee with him to Java City.
Dont know which of these joints is responsible for putting me out of action for 3 days from then.(Luckily none of the others were affected)
Was puking my guts out the whole night and in the end , my flatmate Kanwar took me to Mallaya Hospital in the wee hours of the morning 'cos I couldn't take it anymore ... there they gave me an injection and some tablets.
Thankfully that did the trick - was extremely weak : but survived without anymore vomiting incidents.
Was dog tired the whole weekend , and slowly recovered my strength , stamina and humour :)
Kanwar took care of my food , medicines and was a gem - recovered fast due to him and the others in my flat.
Now am fine and back in action ... but have resolved to eat less from outside (less tending to zero in the forseeable future) ... maybe dad's advice did have some merit :D - following it after 3 years in blr !!!

0 Comments:

Post a Comment

<< Home

Thursday, July 08, 2004

Volume 4 of The Art of Computer Programming by Don Knuth

The online version is available here
According to this , it is supposed to contain subjects that I really enjoy reading up on.
Unlike the previous books which I never read seriously or committedly (my lack of effort) , this one I would be reading in all seriousness.
(Hope there is no prerequisite on the other books - else I will have to read those too to understand this one *sigh*)

By the way , his offer still stands I think - finding errors and giving significant suggestions.
If I EVER get one - that would be the shining accomplishment of my life :D
And will forever be the first thing in my resume (when I get down to write it that is) ... *sigh* no harm in dreaming :(

By the way , thinking of a protocol - explained basic idea to Alok , Ajay B and Rajesh (my prev teams architect).
It looks like a very nice , but potentially impossible (impl wise) idea - maybe I will post it here someday - told Sood that I would .. hence this "bail" :D

0 Comments:

Post a Comment

<< Home

Friday, July 02, 2004

Sinfest

This is an amazing strip :)
Some of them really get to you - I am trying to catch up on the past strips and almost all are really hilarious !
The "You had to be there" ones reminded me too much of me meeting the others - Ajay , Alok , Noufal , Rai , etc.
Most of our conversations do go like how he describes in the strip ... "Eda , you remember when ..." or "Remember the guy who ..." , etc :)
It is awesome fun going through our past :D but must be really irritating to others ;)

The "ninja theatre" episodes are amazing !! Especially the side comments - rip roaring :)
This one I came across today - after having attended 3 tele-marketting calls.
It was smack on target :D - if only I had read this _before_ they had called :))

The fact that he has managed to create such a huge and varied world out of such a crazy set of characters makes it more enjoyable.
Most if not all of the strips are unpredictable (unless ofcourse you are following a "series").
Ofcourse sometimes you do feel that the general tone of a subset of the series is the same ... but then - you dont need to read it continously ! Take a break ;)
The not so indirect jabs at marketting , atheisim and religion are usually my favs :)
Example: http://sinfest.net/d/20010929.html

0 Comments:

Post a Comment

<< Home

Goa trip

Went this weekend to Goa - here is a short summary of what transpired.

It was basically Aparup's treat !
Along with me , Girish and Sreeni were also there : Jerry could not make it at the last minute ... (All these guys work with me and Aparup used to work with me - he left recently , hence the treat).
Caught the Vasco express from Yesvantpur and had a nice trip till Madgoan.
The journey was pleasent. It was very scenic when we crossed the western ghats to get into Goa.

From Madgoan to Calangute was a tough one hour or so journey - esp in the six seater which was jerking up and down most of the time.
The driver though kept the trip lively with his continous torrent of conversation (chatter ?!).

We were put up at the post office guest house at Calangute - thanks to Mr. Natarajan.
It was a very comfortable pad - and also quiet close to the beach : approx 0.75 km or so ...

Unpacked , freshened up and by about 4 went out for our very late lunch - it started drizzling slightly (which was to be the norm for most of our stay ) and the place we ate from was not that great ...
But the view of the beach was very scenic and I had my first taste of Goan cuisine.

Now , this last point deserves some explaination - I am from Kerala and fish , as most might know , has a very prominent place in my normal diet.
Staying in Bangalore for past 3 years or so has made me sorely miss this.
The 4 years before that at college , I had to forsake fish to keep my stomach in operational condition :P
Hence the delicious goan fish preparations were pleasing to my tongue , stomach and my heart :)
To say that I freaked out on fish in my stay at Goa would be putting it mildly !

That day we just spent time frolicking in the beach :)
Dinner was pleasent and again I had - yes fish ;)

Next day was a "tour day" - we went to see the "sights of Goa".
My roomie Rajat came down to Goa (he happened to be at Karvar - quiet close to Goa) with his friends and all of us went together.
Went to a couple of beaches , Aguada fort (awesome view !!) , Basilica of Bon Jesus and Palolem beach.
A very nice guide at the church gave us an interesting history about the basilica in particular and Goa in general.
This was the only day (afternoon) when I had veg food in Goa :P
We could not go for boating at Dona Paula but did have a nice time there - watching the sea :)
The trip back from Palolem beach - which btw is an amazing and extremely peaceful beach , was uneventful : maybe 'cos I was fast asleep the full 90 odd km back :)
Dinner was at a nice hotel called Midas Touch : it would be an understatement to say that Srini had a very nice time here :)

Next day - all of us woke up real late ... this was the day we were to head back - and this did not do much good to our mood.
I had started enjoying Goa by now and was sure going to throw a tantrum 'cos I was being forced to leave it :(
We were to catch our train from Londa , which is across the ghats - a good 2:30 hours or so away.
The journey was nice - though I slept off through most of the car ride - did manage to catch some extremely scenic views on our ride through the ghats.
We reached Londa at 5:15 pm or so - and then find out that Sreeni had misread the train timings - train reaches Londa at 8:00pm not 5:30 :D
The other three decide to take a stroll and explore Londa , while yours truely was emminently lazy and decided to laze it off in the station.
Ofcourse , 30 mins later I was regretting this ...
I met Monica on the platform who was also heading to Bangalore and spent nice time chatting with her until the train arrived.(Speaking of which - I forgot to get her contact number ...)
The train food , as usual , sucked bigtime ... after a long chat , all of us slept : to arrive at Bangalore - surprisingly on time !

Back to the grind ... though I wish I make it back to Goa real quick ...
I am quiet serious about making it there this nov/dec ... time will tell :)

0 Comments:

Post a Comment

<< Home