VCS::LibCVS::Client::Connection.3pm

Langue: en

Autres versions - même langue

Version: 2005-10-10 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

VCS::LibCVS::Client::Connection - a connection to a CVS server

SYNOPSIS

   my $conn = VCS::LibCVS::Client::Connection->new($root);
   my $client = VCS::LibCVS::Client->new($conn, "/home/cvs");
 
 

DESCRIPTION

A connection to a CVS server. Its only real use is to construct a CVS client. It represents a generic connection, but has a constructor, which will instantiate the appropriate subclass.

Once the connection is established, communication with the server takes place through a pair of IO::Handles.

CLASS ROUTINES

new()

$connection = VCS::LibCVS::Client::Connection->new($root);
argument 1 type: VCS::LibCVS::Datum::Root
return type: VCS::LibCVS::Client::Connection

If the protocol is not supported, an exception will be thrown.

INSTANCE ROUTINES

connect()

$connection->connect()
return type: undef

Connect to the server. After this, get_ioh_to_server and get_ioh_from_server may be called. When the connection is no longer necessary, disconnect will get rid of it.

Subclasses must override this method, and use it to set the SubFromServer and SubToServer private variables. They must call this method at the beginning of their implementation, and connect_fin() at the end of it.

connect_fin()

$connection->connect_fin()
return type: undef

Called by subclasses, once they have established the connection, and created the SubFromServer and SubToServer private variables.

disconnect()

$connection->disconnect()
return type: undef

Closes this connection to the server. IO::Handles for communicating with the server will no longer work.

get_ioh_to_server()

$out_ioh = $connection->get_ioh_to_server();
return type: IO::Handle

Returns an open writeable IO::Handle. Stuff written to it is sent to the server.

The connection must be open to call this routine.

get_ioh_from_server()

$in_ioh = $connection->get_ioh_from_server();
return type: IO::Handle

Returns an open readable IO::Handle. Responses generated by the server are read from this IO::Handle.

The connection must be open to call this routine.

connected()

$is_connected = $connection->connected();
return type: boolean scalar

Returns a scalar with a true value if the connection is open, false otherwise.

get_root()

$cvsroot = $connection->get_root();
return type: VCS::LibCVS::Datum::Root

The root of the server that this is a connection to.

SEE ALSO

   VCS::LibCVS::Client
   VCS::LibCVS::Client::Connection::Local