1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 
5 namespace IceInternal
6 {
7     sealed class WSConnector : IceInternal.Connector
8     {
connect()9         public IceInternal.Transceiver connect()
10         {
11             return new WSTransceiver(_instance, _delegate.connect(), _host, _resource);
12         }
13 
type()14         public short type()
15         {
16             return _delegate.type();
17         }
18 
WSConnector(ProtocolInstance instance, IceInternal.Connector del, string host, string resource)19         internal WSConnector(ProtocolInstance instance, IceInternal.Connector del, string host, string resource)
20         {
21             _instance = instance;
22             _delegate = del;
23             _host = host;
24             _resource = resource;
25         }
26 
Equals(object obj)27         public override bool Equals(object obj)
28         {
29             if(!(obj is WSConnector))
30             {
31                 return false;
32             }
33 
34             if(this == obj)
35             {
36                 return true;
37             }
38 
39             WSConnector p = (WSConnector)obj;
40             if(!_delegate.Equals(p._delegate))
41             {
42                 return false;
43             }
44 
45             if(!_resource.Equals(p._resource))
46             {
47                 return false;
48             }
49 
50             return true;
51         }
52 
ToString()53         public override string ToString()
54         {
55             return _delegate.ToString();
56         }
57 
GetHashCode()58         public override int GetHashCode()
59         {
60             return _delegate.GetHashCode();
61         }
62 
63         private ProtocolInstance _instance;
64         private Connector _delegate;
65         private string _host;
66         private string _resource;
67     }
68 }
69