The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::PSYC - Implementation of the Protocol for SYnchronous Conferencing.

DESCRIPTION

PSYC is an innovative protocol for chat servers and conferencing in general. It is intended to overcome problems of traditional approaches like IRC and ICQ. But you may aswell use it as a simple all-purpose messaging protocol.

This implementation is in beta state, the application programming interface (API) may change in future versions until version 1.0 is released.

See http://psyc.pages.de for protocol specs and other info on PSYC.

SYNOPSIS

    # small example on how to send one single message:
    use Net::PSYC;
    sendMSG('psyc://myhost/~someuser', '_notice_whatever', 
            'Whatever happened to the 80\'s...');

            
    # receive messages...
                    # Event, Gtk2 is possible too
    use Net::PSYC qw(Event=IO::Select startLoop registerPSYC); 
    registerPSYC(); # get all messages
    bindPSYC(); # start listening on :4404 tcp and udp.
    
    startLoop(); # start the Event loop
    
    sub msg {
        my ($source, $mc, $data, $vars) = @_;
        print "A message ($mc) from $source reads: '$data'\n";
    }    
 

PERL API

bindPSYC( $localpsycUNI )

Starts listening on a local hostname and TCP and/or UDP port according to the PSYC UNI specification. When omitted, a random port will be chosen for both service types.

sendMSG( $target, $mc, $data, $vars )

compatible to psycMUVEs sendmsg, accepts four of five PSYC packet elements, source being defined by setSRC if necessary.

sendMMP( $target, $data, $vars )

sends a MMP packet to the given $target. $data may be a reference to an array of fragmented data.

psyctext( $format, $vars )

compatible to psycMUVEs psyctext, renders the strings in $vars into the $format and returns the resulting text conformant to the text/psyc content type specification.

makeUNL( $user, $host, $port, $type, $object )

produces a PSYC UNI out of the given elements.

UNL()

returns the current complete source UNI.

accept_modules( @modules )
refuse_modules( @modules )

Set or get modules currently accepted by the MMP part of your PSYC application. Changes to this setting do not take effect in established connections. ( Have a look at getConnection and Net::PSYC::Circuit::accept_modules()! ) Modules that are understood by the current version are _state, _fragment, _length and _onion of which _state, _fragment and _length are accepted by default.

Eventing

addReadable, removeReadable and waitPSYC implement a pragmatic IO::Select wrapper for applications that do not need any other event management like Event.pm. See Net::PSYC::Event for more.

You may also find it useful to export the following: makeMSG, parseUNL, parse, setBASE, setSRC, setDEBUG

For further details.. Use The Source, Luke!

SEE ALSO

Net::PSYC::Event, Net::PSYC::Client, http://psyc.pages.de for more information about the PSYC protocol, http://muve.pages.de for a rather mature psyc server implementation (also offering irc, jabber and a telnet-interface)

AUTHORS

Carlo v. Loesch

psyc://ve.symlynX.com/~lynX

http://symlynX.com/

Arne Gödeke

psyc://ve.symlynx.com/~elridion

http://www.elridion.de/

COPYRIGHT

Copyright (c) 1998-2004 Carlo v. Loesch and Arne Gödeke. All rights reserved.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. Derivatives may not carry the title "Official PSYC API Implementation" or equivalents.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 573:

Unknown directive: =wu