tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: TomCat 7 + Socket & Java Version
Date Tue, 17 May 2011 13:26:30 GMT
Micka,

I'm glad that someone could help you after you provide better/clearer information.

Just for future reference :

Micka wrote:
> Ok,
> 
> Machine A :
> OS : Windows Seven
> JVM : jre6
> Tomcat :  v7.0.8
> 
> Machine B :
> OS : Ubuntu 10.04
> Using CATALINA_BASE:   /usr/local/tomcat7
> Using CATALINA_HOME:   /usr/local/tomcat7
> Using CATALINA_TMPDIR: /usr/local/tomcat7/temp
> Using JRE_HOME:        /usr/lib/jvm/java-6-sun
> Using CLASSPATH:
> /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar
> Server version: Apache Tomcat/7.0.12
> Server built:   Apr 1 2011 06:13:02
> Server number:  7.0.12.0
> OS Name:        Linux
> OS Version:     2.6.32-24-server
> Architecture:   amd64
> JVM Version:    1.6.0_24-b07
> JVM Vendor:     Sun Microsystems Inc.
> 

Very good.  With that kind of information, people here know the basics of your system(s),

and can help much quicker and better, as you have seen.

> 
> 
> 
> 
> B) What I do :
> step 1 : start TomCat on the server
> step 2 : Looking at the log :
> step 3 : The application works as a TCP server.
> step 4 : a connection is established with a client
> step 5 : the server send   1 1 1 5 *252* 2 6 1   ( char array ) to a client
> step 6 : the client confirmed the data by sending back an echo :   1 1 1 5 *
> 63* 2 6 1
> step 7 : the server detect that the echo is different of what It sent, it
> resend the data.
> step 8 : jump to step 5
> 

That is better than before, but still a bit confusing :

In step 3, you say that the application works as a server.
OK. That is what one usually expects from a Tomcat application.
But,
In step 4, you say that a connection is established with a client.

That is confusing, because in the TCP protocol, it is a client which establishes the 
connection with a server.  The server opens a "listening" socket, and then just waits for

client connections.  A client establishes a connection with that server socket, and then 
normally it is the client which sends something to the server (a request, a command,..), 
and the server responds.  Then the connection may be closed, or it may stay open, allowing

for another client request and server response.
That is how HTTP works, and in the Tomcat environment and on this list, most people would

expect that, by default, you are talking about HTTP requests/responses.

So basically at this point, you have most of us confused.

It gets even more confusing, because you never tell us what this "client" really is, and 
why it would "echo" something back to the "server".
So that is why you are not getting a lot of responses.

Except from a guru like Konstantin, who was able to brilliantly sift through the obscure 
explanation, and devine that your basic problem may just be a question of character encoding.
But you should not take this as a general rule.  The people here are generally good, but 
they only have their genius moments from time to time.

Reviewing your above explanation (for the 3rd time), I would now think that in fact, your

Tomcat application works as a TCP client, not as a server.  It is this application which 
creates its own client connection with some other server, right ?  And it is that other 
server which sends back an echo of the data, right ? Or am I still confused ?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message