Thx for the advise, My mail will be better for the next time. To explain better my application, it is a TCP server. And it received connection requests from clients.
In my configuration I'm automatically waiting and accepting a connection with : java.net.ServerSocket.accept() After that I give the socket to a Thread to communicate with the device. In my case the device, works with commands. And to check if there is no errors during the communication, It send me back an echo. Each time that i send a command, I check if the echo is the same, if not, I create an Exception. is that better ? :p On Tue, May 17, 2011 at 3:26 PM, André Warnier <a...@ice-sa.com> wrote: > 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-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >