You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Zoltan Farkas <zo...@daxtechnologies.com> on 2006/01/12 17:27:49 UTC

[mina] help with implementing a syslog server with mina

I am trying to implement a syslog server with mina.

 

The syslog protocol sends the messages in UDP packets (1 UDP pachet /
message), messages are variable in size

 

Mina creates one Iosession / UDP packet received.

 

Since the syslog message size is not standard and for UDP transport
Session open and close is not called (for IOProtocolAdapter) I cannot
know when I have the complete message, since I assume the buffer can
countain a partial UDP message ...

 

Can anybody give me a hint how to implement this server?

 

Right now I am trying to implement a MessageDecoder, but again I don't
know when I have a complete message in the buffer !!!

 

thanks

 

--zoly

 

 

 


Re: [mina] help with implementing a syslog server with mina

Posted by Kaspar Luethi <ka...@humantools.ch>.
try the docs, it helps :)
looks like you never get more than 1 packet per message
(typically UDP max. packet size is > 1024).

The BSD Syslog Protocol
http://www.ietf.org/rfc/rfc3164.txt
Reliable Delivery for syslog
http://www.ietf.org/rfc/rfc3195.txt

----

4.1 syslog Message Parts

        The full format of a syslog message seen on the wire has three
        discernable parts.  The first part is called the PRI, the second part
        is the HEADER, and the third part is the MSG.  The total length of
        the packet MUST be 1024 bytes or less.

4.1.3 MSG Part of a syslog Packet

       The MSG part will fill the remainder of the syslog packet.  This will
       usually contain some additional information of the process that
       generated the message, and then the text of the message.  There is no
       ending delimiter to this part.


      If the relay adds a TIMESTAMP, or a TIMESTAMP and HOSTNAME, after the
      PRI part, then it MUST check that the total length of the packet is
      still 1024 bytes or less.  If the packet has been expanded beyond
      1024 bytes, then the relay MUST truncate the packet to be 1024 bytes.

----

kaspar



>I am trying to implement a syslog server with mina.
>
>The syslog protocol sends the messages in UDP packets (1 UDP pachet
>/ message), messages are variable in size
>
>Mina creates one Iosession / UDP packet received.
>
>Since the syslog message size is not standard and for UDP transport
>Session open and close is not called (for IOProtocolAdapter) I
>cannot know when I have the complete message, since I assume the
>buffer can countain a partial UDP message Š
>
>Can anybody give me a hint how to implement this server?
>
>Right now I am trying to implement a MessageDecoder, but again I
>don't know when I have a complete message in the buffer !!!
>
>thanks
>
>--zoly
-- 
---------------------------------------------
  http://www.humantools.com