title: Getting Access Denied Exception while trying to Open Socket In Silverlight
body: <p>I am getting Access Denied exception while trying to open a socket.
  My connect function is as shown.</p>
  
  <pre><code>internal void Connect()
          {
              try
              {
                  //AccessPolicy = new SocketClientAccessPolicyProtocol();
  
  
                  args = new SocketAsyncEventArgs();
  
  
                  args.UserToken = socket;
                  args.RemoteEndPoint = endPoint;
                  args.Completed += new EventHandler&lt;SocketAsyncEventArgs&gt;(OnConnect);
  
                  **isConnected = socket.ConnectAsync(args);**
                  //autoEvent.WaitOne();
  
                  if (args.SocketError != SocketError.Success)
                      throw new SocketException((int)args.SocketError);
                  if(isConnected)
                  global::System.Windows.MessageBox.Show("Connected");
              }
              catch (Exception ex)
              {
                  global::System.Windows.MessageBox.Show(ex.Message);
              }
          }
  </code></pre>
  
  <p>The function ConnectAsync however is executing fine as isConnected is coming true but socket is not getting connected.</p>