MessageReader is half-gone from versaplexd/t/*.cs.
[versaplex.git] / dbus-sharp / Transport.cs
blobdccac409f58de79179f540c8f9ffdea74fcfca1c
1 // Copyright 2006 Alp Toker <alp@atoker.com>
2 // This software is made available under the MIT License
3 // See COPYING for details
5 using System;
6 using System.IO;
8 namespace Wv.Transports
10 public abstract class Transport
12 public static Transport Create (AddressEntry entry)
14 switch (entry.Method) {
15 case "tcp":
17 Transport transport = new SocketTransport ();
18 transport.Open (entry);
19 return transport;
21 #if !PORTABLE
22 case "unix":
24 //Transport transport = new UnixMonoTransport ();
25 Transport transport = new UnixNativeTransport ();
26 transport.Open (entry);
27 return transport;
29 #endif
30 default:
31 throw new NotSupportedException ("Transport method \"" + entry.Method + "\" not supported");
35 protected Connection connection;
37 public Connection Connection
39 get {
40 return connection;
41 } set {
42 connection = value;
46 //TODO: design this properly
48 //this is just a temporary solution
49 public Stream Stream;
50 public long SocketHandle;
51 public abstract void Open (AddressEntry entry);
52 public abstract string AuthString ();
53 public abstract void WriteCred ();