Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #16043

Re: serversocket

From Lucyann Lenon Emerick De Assis <lucyann.lenon@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: serversocket
Date 2012-07-16 04:54 -0700
Organization http://groups.google.com
Message-ID <2753cc51-51df-4a3e-b92d-21ebe6309248@googlegroups.com> (permalink)
References <15b1bc5d-160d-4048-8ad7-2cff9cf862e0@googlegroups.com> <76cf48db-123d-4888-ac60-4b80ccfdeea4@googlegroups.com> <jtsmrv$djo$1@news.albasani.net> <jtsnaj$efi$1@news.albasani.net> <c64ee38e-33db-4da9-a911-6c601fe24fdd@googlegroups.com>

Show all headers | View raw


Em segunda-feira, 16 de julho de 2012 08h49min06s UTC-3, Lucyann Lenon Emerick De Assis  escreveu:
> Well, first I thank you for the answer, and guidelines apply to my learning!
> the customer is a good model tk 102 gps, if not I engando communicates via tcp.
> What struck me is that the same code works on a smartphone, I used the tracker to emulate mylive sending data tk 102
> Em sábado, 14 de julho de 2012 18h12min22s UTC-3, Lew  escreveu:
> &gt; Lew wrote:
> &gt;   ... [snip] ...
> &gt; &amp;gt; /* Track
> &gt; &amp;gt;   * $RCSfile$
> &gt; &amp;gt;   */
> &gt; &amp;gt; package eegee;
> &gt; 
> &gt;   ...
> &gt; 
> &gt; &amp;gt; public class Track
> &gt; &amp;gt; {
> &gt; 
> &gt;   ...
> &gt; 
> &gt; &amp;gt;    private static void serveConnections(ServerSocket serverSocket)
> &gt; &amp;gt;    {
> &gt; &amp;gt;      while (true)
> &gt; &amp;gt;      {
> &gt; &amp;gt;        final Socket connectionSocket;
> &gt; &amp;gt;        try
> &gt; &amp;gt;        {
> &gt; &amp;gt;          connectionSocket = serverSocket.accept();
> &gt; &amp;gt;        }
> &gt; &amp;gt;        catch (IOException exc)
> &gt; &amp;gt;        {
> &gt; &amp;gt;          logger.error(BAD_CONNECT, exc);
> &gt; &amp;gt;          return;
> &gt; &amp;gt;        }
> &gt; &amp;gt;        assert connectionSocket != null;
> &gt; &amp;gt;
> &gt; &amp;gt;        try
> &gt; &amp;gt;        {
> &gt; &amp;gt;          handleClient(connectionSocket);
> &gt; &amp;gt;        }
> &gt; &amp;gt;        finally
> &gt; &amp;gt;        {
> &gt; &amp;gt;          close(connectionSocket);
> &gt; &amp;gt;        }
> &gt; &amp;gt;      }
> &gt; &amp;gt;    }
> &gt;   ...
> &gt; 
> &gt; I made a mistake in the &amp;#39;serveConnections()&amp;#39; method, arguably. Or maybe it 
> &gt; isn&amp;#39;t a mistake.
> &gt; 
> &gt; What do you think; is it a mistake or not?
> &gt; 
> &gt; -- 
> &gt; Lew
> &gt; Honi soit qui mal y pense.
> &gt; http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
you're telling me I have to create a client and not a server socket?, and as I receive data connection?

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

serversocket Lucyann Lenon Emerick De Assis <lucyann.lenon@gmail.com> - 2012-07-14 05:41 -0700
  Re: serversocket Joerg Meier <joergmmeier@arcor.de> - 2012-07-14 16:40 +0200
    Re: serversocket Lew <noone@lewscanon.com> - 2012-07-14 13:04 -0700
      Re: serversocket Joerg Meier <joergmmeier@arcor.de> - 2012-07-15 00:42 +0200
  Re: serversocket Lucyann Lenon Emerick De Assis <lucyann.lenon@gmail.com> - 2012-07-14 07:56 -0700
    Re: serversocket Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2012-07-14 10:23 -0700
      Re: serversocket Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-15 00:29 +0000
    Re: serversocket Lew <noone@lewscanon.com> - 2012-07-14 14:04 -0700
      Re: serversocket Lew <noone@lewscanon.com> - 2012-07-14 14:12 -0700
        Re: serversocket Lucyann Lenon Emerick De Assis <lucyann.lenon@gmail.com> - 2012-07-16 04:49 -0700
          Re: serversocket Lucyann Lenon Emerick De Assis <lucyann.lenon@gmail.com> - 2012-07-16 04:54 -0700
            Re: serversocket Lew <lewbloch@gmail.com> - 2012-07-16 13:59 -0700

csiph-web