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


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

Re: Socket problem: read & write to same socket

From Nigel Wade <nmw@le.ac.uk>
Newsgroups comp.lang.java.programmer
Subject Re: Socket problem: read & write to same socket
Date 2012-03-15 12:30 +0000
Message-ID <9se5nuFae4U1@mid.individual.net> (permalink)
References (3 earlier) <jjog7u$ts6$2@localhost.localdomain> <4f5fc93f$0$295$14726298@news.sunsite.dk> <27729487.119.1331678296341.JavaMail.geo-discussion-forums@pbfz10> <4f5fce87$0$285$14726298@news.sunsite.dk> <jjolfv$qp$1@localhost.localdomain>

Show all headers | View raw


On 13/03/12 23:33, Martin Gregorie wrote:
> On Tue, 13 Mar 2012 18:47:36 -0400, Arne Vajhøj wrote:
>
>> On 3/13/2012 6:38 PM, Lew wrote:
>>> Then the OP may want to have the first thing the client does be a send
>>> rather than a receive, per Martin's comment.
>>
>> Why?
>>
>> It is way more common for client to send first, but there is no reason
>> why server sending first should not work.
>>
> I've been thinking over the servers protocols I know. The only one I can
> think of where the process accepting the connection speaks first is SMTP,
> where the server that accepts the connection announces who it is before
> seeing what its peer has to say. Arguably, this is a slightly different
> case since SMTP is a peer-to-peer protocol rather than a client-server
> one.
>
>

SMTP is most definitely a client-server protocol.

There are strict clients (MCA, mail client agents), which only ever submit messages to a server.
There are strict servers (MDA, mail delivery agents), which only ever receive messages for local delivery.
Then there are servers (MTA, mail transport agents) which act as servers to receive messages, and as clients to forward messages to other servers.

Just because a MTA can act as both client and server doesn't change the fact that the protocol it uses is client-server. A new connection is established for every transaction, the MTA will be a server in that connection when receiving messages and a client when forwarding them.

-- 
Nigel Wade

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


Thread

Socket problem: read & write to same socket liyaohua.bupt@gmail.com - 2012-03-13 09:01 -0700
  Re: Socket problem: read & write to same socket Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 12:14 -0400
    Re: Socket problem: read & write to same socket liyaohua.bupt@gmail.com - 2012-03-13 09:30 -0700
      Re: Socket problem: read & write to same socket Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-03-13 10:30 -0700
  Re: Socket problem: read & write to same socket Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-13 21:33 +0000
    Re: Socket problem: read & write to same socket Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 17:48 -0400
      Re: Socket problem: read & write to same socket Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-13 22:03 +0000
        Re: Socket problem: read & write to same socket Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 18:25 -0400
          Re: Socket problem: read & write to same socket Lew <lewbloch@gmail.com> - 2012-03-13 15:38 -0700
            Re: Socket problem: read & write to same socket Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 18:47 -0400
              Re: Socket problem: read & write to same socket Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-13 23:33 +0000
                Re: Socket problem: read & write to same socket Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 19:35 -0400
                Re: Socket problem: read & write to same socket Paul Cager <paul.cager@googlemail.com> - 2012-03-14 02:51 -0700
                Re: Socket problem: read & write to same socket Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-15 00:45 +0000
                Re: Socket problem: read & write to same socket Paul Cager <paul.cager@googlemail.com> - 2012-03-15 03:18 -0700
                Re: Socket problem: read & write to same socket RedGrittyBrick <RedGrittyBrick@spamweary.invalid> - 2012-03-14 16:22 +0000
                Re: Socket problem: read & write to same socket glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-03-15 01:33 +0000
                Re: Socket problem: read & write to same socket Nigel Wade <nmw@le.ac.uk> - 2012-03-15 12:30 +0000
          Re: Socket problem: read & write to same socket Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-13 23:00 +0000
            Re: Socket problem: read & write to same socket Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 19:36 -0400

csiph-web