Hi Friends,
            I am developing a Chat Software using Applet-Sockets(Server to
be a Servlet in Future) . I am using Obj. Serialization for the
Communication extensively. THe communication takes place using Objects like
Header for header information like Ahuthenitication, Command Objects for
notifications like Join a Room or Leave a Room etc.

       I had posted a query on this some time back but this time this new
problem is mind boggling.
      The problem is that when the user is connecting to the Server & being
authenicated. After that the server say authenticated OK. Now the Applet
show the Chat Room with Common Messages Text Area, USers list etc. Now the
Applet asks for the Users list in the form of an Object called Header like
this
      Header header = new Header("GETUSERSLIST");
      oout.writeObject(header);
      oout.flush();
The Server does receive this Object & asks the MainServer to get the Users
list. The Thread running on the Server then sends it in form of Comma
seperated list of users name in the Form of another Header Object like this
        Header userslistheader = new Header("TAKEUSERSLIST ["+userlist+"]");
       toclient.writeObject(userslistheader);
       toclient.flush();
But here is the Problem the Client Applet does receive this but not as
instance of Header class but of Command class??

       Why??
How is that the Command class & Header class be inter-changeable. When they
have nothing to do.

I feel something nasty going on some where or bug in Obj. Serialization
Sometimes back I was getting StreamCorruptedException : Type code is out of
Range -84. Below is the Java Console output

Java(TM) Plug-in: Version 1.2.2.px
Using JRE version 1.2.2
User home directory = C:\WINNT\Profiles\jiger
Proxy Configuration: no proxy
JAR cache disabled.
Opening http://200.200.200.1/Chat.zip no proxy
Came in init()
Opening
http://200.200.200.1/com/patelsoft/client/ChatClientAppletBeanInfo.class no
proxy
CacheHandler file name: null
Opening http://200.200.200.1/sun/beans/infos/ChatClientAppletBeanInfo.class
no proxy
CacheHandler file name: null
Waiting for Response :Got Object(response) :AUTHEN OK
true
Waiting  for Response from Server in ReadResponseTHread.But Started
Exception in ReadResponseTHread :java.io.StreamCorruptedException: Type code
out of range, is -84
Waiting  for Response from Server in ReadResponseTHread.But Started
Exception in ReadResponseTHread :java.io.StreamCorruptedException: Unknown
code in readObject -84
Waiting  for Response from Server in ReadResponseTHread.But Started
Exception in ReadResponseTHread :java.io.StreamCorruptedException: Type code
out of range, is -19
Waiting  for Response from Server in ReadResponseTHread.But Started
Exception in ReadResponseTHread :java.io.StreamCorruptedException: Unknown
code in readObject -19
Waiting  for Response from Server in ReadResponseTHread.But Started
Exception in ReadResponseTHread :java.io.StreamCorruptedException: Type code
out of range, is 0
Waiting  for Response from Server in ReadResponseTHread.But Started
Exception in ReadResponseTHread :java.io.StreamCorruptedException: Type code
out of range, is 5
Waiting  for Response from Server in ReadResponseTHread.But Started
Exception in ReadResponseTHread :java.io.StreamCorruptedException: Unknown
code in readObject 5
Waiting  for Response from Server in ReadResponseTHread.But Started
ReadResponseThread received the Following Object JOIN [Jiger]
GOt New Command :JOIN [Jiger]
Waiting  for Response from Server in ReadResponseTHread.But Started
ReadResponseThread received the Following Object TAKEUSERSLIST [Jiger,]
After while
Waiting  for Response from Server in ReadResponseTHread.But Started

This Problem is somehow solved but this new Problem of Header Object being
acessible with Command Object & not Header class is funny.

Please help me

Thanks in Advance.
Jiger
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to