Search This Blog

Wednesday, September 21

CN -TCP


This is a very amateur program i hv written..i guess its easy to understand with this example



IMP NOTE : Both programs are seperate...but are interdependent on each other..

How to run:
1)run server file in java compiler (eg jcreator,netbeans,cmd etc..)
2)run client file in another java compiler
3)enjoy

sample screenshot:








1 comment:

  1. MISTAKE:
    Very stupid of me ...
    I check if c_msg is bye on server side
    like this: while(c_msg!="bye");
    c_msg is a object of class String..
    c_msg simply would be just reference of Object c_msg

    So c_msg!="bye"
    has reference on lhs
    and String on rhs
    and hence cant be compared

    CORRECTION:
    Replace that code by:
    while(!c_msg.equals("bye"));

    Note:use same correction on client side too

    ReplyDelete