﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SmartCode Solutions Web Forum » SmartCode ViewerX VNC Viewer ActiveX » General Discussion  » ConnectionAccepted Event</title><generator>InstantForum.NET 2010-5</generator><description>SmartCode Solutions Web Forum</description><link>http://www.s-code.com/forum/</link><webMaster>SmartCode Solutions Web Forum</webMaster><lastBuildDate>Mon, 21 May 2012 05:13:21 GMT</lastBuildDate><ttl>20</ttl><item><title>ConnectionAccepted Event</title><link>http://www.s-code.com/forum/FindPost2876.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;In my application I have used the ConnectEx method to establish a connection to my server.&lt;/P&gt;&lt;P&gt;I have added the Disconnected Event and the ConnectionAccepted Events.&lt;/P&gt;&lt;P&gt;In the Disconnected event method call I have called the ListenEx method on the port I am using.&lt;/P&gt;&lt;P&gt;In the ConnectionAccepted method call, i have called ConnectEx again to re-establish the connection and then StopListen().&lt;/P&gt;&lt;P&gt;I was expecting the Disconnected event method call to start listening for a reconnection to the server and then the control would fire the ConnectionAccepted event when the server recovers but the ConnectionAccepted event is never fired. Am I missing something or have I interepreted the events and methods supplied incorrectly?&lt;/P&gt;&lt;P&gt;Any help on this would be greatly appreciated,&lt;/P&gt;&lt;P&gt;Karen</description><pubDate>Tue, 05 Jan 2010 20:17:29 GMT</pubDate><dc:creator>KarenS</dc:creator></item><item><title>RE: ConnectionAccepted Event</title><link>http://www.s-code.com/forum/FindPost2881.aspx</link><description>Please find sampe project attached.</description><pubDate>Tue, 05 Jan 2010 20:17:29 GMT</pubDate><dc:creator>Yury Averkiev (s-code)</dc:creator></item><item><title>RE: ConnectionAccepted Event</title><link>http://www.s-code.com/forum/FindPost2880.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;Yes the code is a bit dodgy, it was a hack to try the control out. :)&lt;/P&gt;&lt;P&gt;Can you post an example of how to get the ConnectionAccepted event to be fired? I have tried just listening and starting the VNC Server on the other PC and nothing happens. :(&lt;/P&gt;&lt;P&gt;Thanks, Karen</description><pubDate>Tue, 05 Jan 2010 10:05:32 GMT</pubDate><dc:creator>KarenS</dc:creator></item><item><title>RE: ConnectionAccepted Event</title><link>http://www.s-code.com/forum/FindPost2879.aspx</link><description>&lt;FONT color=#1f5080&gt;1. usually it's a good idea to subscribe to the events before calling Connect/Listen methods. So you should subscribe first and then doing the connecting stuff.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;2. void&lt;/FONT&gt;&lt;FONT size=2&gt; viewerX_ConnectionAccepted  part is comletely wrong. As I mentioned, when you receive ConnectionAccepted even it means that VNC connection has been established. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Basically the code is a bit mish mash, you are establishing a VNC connection via the Connect method and at the same time want to run a listening VNC viewer.&lt;BR&gt;Are you trying to establish connection from ViewerX to VNC server or want to run ViewerX in a listening mode?</description><pubDate>Tue, 05 Jan 2010 08:45:17 GMT</pubDate><dc:creator>Yury Averkiev (s-code)</dc:creator></item><item><title>RE: ConnectionAccepted Event</title><link>http://www.s-code.com/forum/FindPost2878.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I have included the basic format of my code below. If I start my application with the VNC Server running on the other PC then it connects fine. When I stop the server running on the other PC the disconnected event is fired. But after that when I restart the VNC Server on the other PC the ConnectionAccepted event is never fired. Any idea why this event is not fired?&lt;/P&gt;&lt;P&gt;Thanks, karen&lt;/P&gt;&lt;P&gt;public&lt;FONT color=#000000 size=2&gt; VNCPage (&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;InitializeComponent();&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;viewerX.ConnectEx( "PCName", 5900, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"hello"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; );&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;viewerX.Disconnected += &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;EventHandler&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;( viewerX_Disconnected );&lt;/P&gt;&lt;P&gt;viewerX.ConnectionAccepted += &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; AxViewerX.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;_ISmartCodeVNCViewerEvents_ConnectionAcceptedEventHandler&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;( viewerX_ConnectionAccepted );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; viewerX_ConnectionAccepted( &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; sender, AxViewerX.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;_ISmartCodeVNCViewerEvents_ConnectionAcceptedEvent&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; e )&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;viewerX.ConnectEx( "PCName", 5900, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"hello"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; );&lt;/P&gt;&lt;P&gt;viewerX.StopListen();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; viewerX_Disconnected ( &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; e )&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;viewerX.ListenEx( 5900 );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 05 Jan 2010 08:09:26 GMT</pubDate><dc:creator>KarenS</dc:creator></item><item><title>RE: ConnectionAccepted Event</title><link>http://www.s-code.com/forum/FindPost2877.aspx</link><description>Hi Karen,&lt;BR&gt;ConnectionAccepted gets fired when a listening ViewerX accepts incoming connection from a VNC server. So if you have received this event it means that connection from a VNC server has been accepted and VNC session is in progress.&lt;/P&gt;&lt;P&gt;The Connected event is fired when you establish connection via one of the ConnectXXX methods. &lt;/P&gt;&lt;P&gt;Please note that if you want ViewerX to be in listening mode after a connection was closed. You would have to call Listen/Ex method in the Disconnected event handler.&lt;/P&gt;&lt;P&gt;Please let me know if you need any additional assistance.</description><pubDate>Tue, 05 Jan 2010 07:11:07 GMT</pubDate><dc:creator>Yury Averkiev (s-code)</dc:creator></item></channel></rss>
