Jump to content
The simFlight Network Forums

VulcanB2

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by VulcanB2

  1. Hi,

    My connect code reads something like this:

        Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnect.Click
    
            If f.FSUIPC_Open(FSUIPCInterop.Fsuipc.SIM_FS2K4, FSUIPC_ERR) Then
                txtStatus.Text = "Open!"
            Else
                txtStatus.Text = "STATUS: " & GetFSUIPCErr(FSUIPC_ERR)
            End If
    
        End Sub
    

    GetFSUIPCErr reads something like:

        Private Function GetFSUIPCErr(ByVal FSUIPC_ERR As Integer) As String
    
            Select Case FSUIPC_ERR
                Case FSUIPC_ERR_ATOM
                    GetFSUIPCErr = "Failed to create Atom for mapping filename"
    
                Case FSUIPC_ERR_BUFOVERFLOW
                    GetFSUIPCErr = "Buffer Overflow"
    
                Case FSUIPC_ERR_DATA
                    GetFSUIPCErr = "IPC request contains bad data"
    
                Case FSUIPC_ERR_MAP
                    GetFSUIPCErr = "Failed to create a file mapping object"
    
                Case FSUIPC_ERR_NODATA
                    GetFSUIPCErr = "Call cannot execute: no requests accumulated"
    
                Case FSUIPC_ERR_NOFS
                    GetFSUIPCErr = "Cannot link to FSUIPC or WideClient"
    
                Case FSUIPC_ERR_NOTOPEN
                    GetFSUIPCErr = "Call cannot execute, link not Open"
    
                Case FSUIPC_ERR_OK
                    GetFSUIPCErr = "OK!"
    
                Case FSUIPC_ERR_OPEN
                    GetFSUIPCErr = "Attempt to Open when already Open"
    
                Case FSUIPC_ERR_REGMSG
                    GetFSUIPCErr = "Failed to Register common message with Windows"
    
                Case FSUIPC_ERR_RUNNING
                    GetFSUIPCErr = "Maybe running on WideClient, but FS not running on Server, or wrong FSUIPC"
    
                Case FSUIPC_ERR_SENDMSG
                    GetFSUIPCErr = "IPC sendmessage failed all retries"
    
                Case FSUIPC_ERR_SIZE
                    GetFSUIPCErr = "Size Error"
    
                Case FSUIPC_ERR_TIMEOUT
                    GetFSUIPCErr = "IPC timed out all retries"
    
                Case FSUIPC_ERR_VERSION
                    GetFSUIPCErr = "Incorrect version of FSUIPC, or not FSUIPC"
    
                Case FSUIPC_ERR_VIEW
                    GetFSUIPCErr = "Failed to open a view to the file map"
    
                Case FSUIPC_ERR_WRONGFS
                    GetFSUIPCErr = "Sim is not version requested"
    
                Case Else
                    GetFSUIPCErr = "No Error"
    
            End Select
    
        End Function
    

    All the above code is because I found the Try...Catch didn't work.

    If you want to detect that FS is running then connect, you're going to need to set a flag somewhere that says the connection is open already, so it doesn't perpetually try opening an already opened connction.

    e.g.

        Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnect.Click
    
            If FSUIPC_CONN_OPEN Then Exit Sub
    
            If f.FSUIPC_Open(FSUIPCInterop.Fsuipc.SIM_FS2K4, FSUIPC_ERR) Then
                txtStatus.Text = "Open!"
                FSUIPC_CONN_OPEN = True
            Else
                txtStatus.Text = "STATUS: " & GetFSUIPCErr(FSUIPC_ERR)
            End If
    
        End Sub
    

    You could even get it so the code disables the connect timer when a connection is made, but you'd need a way to detect the connection failed, and either re-connect or generate an error saying why it can't reconnect.

    Best regards,

    Robin.

  2. Hi,

    No - not yet. I'm just getting started with programming FS. I saw the document was written in 2005 although included with the latest SDK, so wasn't sure if it was still current.

    It will be something I'd be interested in though at some point. My app is running outside of FS due to my inability to code in C++, so would be useful (unless it's possible anyway?).

    Best regards,

    Robin.

  3. Hi,

    I'm on a fixed IP.

    It seems to be being accepted:

    "TCPIP"	1260	"2008-08-18 13:24:31.017"	"Created accept socket 1600 on listening socket 1364"
    "SMTPD"	1260	2218	"2008-08-18 13:24:31.017"	"172.16.0.10"	"SENT: 220  ESMTP"
    "SMTPD"	1260	2218	"2008-08-18 13:24:31.047"	"172.16.0.10"	"RECEIVED: EHLO [172.16.0.10]"
    "SMTPD"	1260	2218	"2008-08-18 13:24:31.047"	"172.16.0.10"	"SENT: 250-hmailserver[nl]250-SIZE[nl]250 AUTH LOGIN"
    "SMTPD"	1260	2218	"2008-08-18 13:24:31.047"	"172.16.0.10"	"RECEIVED: AUTH LOGIN"
    "SMTPD"	1260	2218	"2008-08-18 13:24:31.047"	"172.16.0.10"	"SENT: 334 AUTH1"
    "SMTPD"	1260	2218	"2008-08-18 13:24:33.911"	"172.16.0.10"	"RECEIVED: AUTH REPLY"
    "SMTPD"	1260	2218	"2008-08-18 13:24:33.911"	"172.16.0.10"	"SENT: 334 AUTH2"
    "SMTPD"	1260	2218	"2008-08-18 13:24:33.941"	"172.16.0.10"	"RECEIVED: ***"
    "SMTPD"	1260	2218	"2008-08-18 13:24:33.941"	"172.16.0.10"	"SENT: 235 authenticated."
    "SMTPD"	1260	2218	"2008-08-18 13:24:33.971"	"172.16.0.10"	"RECEIVED: MAIL FROM: SIZE=745"
    "SMTPD"	1260	2218	"2008-08-18 13:24:33.971"	"172.16.0.10"	"SENT: 250 OK"
    "SMTPD"	1260	2218	"2008-08-18 13:24:33.991"	"172.16.0.10"	"RECEIVED: RCPT TO:"
    "SMTPD"	1260	2218	"2008-08-18 13:24:33.991"	"172.16.0.10"	"SENT: 250 OK"
    "SMTPD"	1260	2218	"2008-08-18 13:24:34.021"	"172.16.0.10"	"RECEIVED: DATA"
    "SMTPD"	1260	2218	"2008-08-18 13:24:34.021"	"172.16.0.10"	"SENT: 354 OK, send."
    "SMTPD"	1260	2218	"2008-08-18 13:24:34.071"	"172.16.0.10"	"SENT: 250 Queued (0.040 seconds)"
    "TCPIP"	1180	"2008-08-18 13:24:34.071"	"DNS - MX Lookup: btconnect.com"
    "SMTPD"	1260	2218	"2008-08-18 13:24:34.091"	"172.16.0.10"	"RECEIVED: QUIT"
    "SMTPD"	1260	2218	"2008-08-18 13:24:34.091"	"172.16.0.10"	"SENT: 221 goodbye"
    "TCPIP"	1180	"2008-08-18 13:24:34.091"	"DNS - MX Result: 1 IP addresses were found."
    "TCPIP"	1260	"2008-08-18 13:24:34.161"	"Disconnecting socket 1552 for session 2218"
    "SMTPC"	1260	2219	"2008-08-18 13:24:34.472"	"213.123.26.151"	"RECEIVED: 220 c2beaimr02.btconnect.com ESMTP; Mon, 18 Aug 2008 13:23:23 +0100 (BST)"
    "SMTPC"	1260	2219	"2008-08-18 13:24:34.472"	"213.123.26.151"	"SENT: HELO "
    "SMTPC"	1260	2219	"2008-08-18 13:24:34.502"	"213.123.26.151"	"RECEIVED: 250 c2beaimr02.btconnect.com Hello  [], pleased to meet you"
    "SMTPC"	1260	2219	"2008-08-18 13:24:34.502"	"213.123.26.151"	"SENT: MAIL FROM:"
    "TCPIP"	1256	"2008-08-18 13:24:41.111"	"Created accept socket 1552 on listening socket 1372"
    "POP3D"	1256	2220	"2008-08-18 13:24:41.111"	"172.16.0.10"	"SENT: +OK POP3"
    "POP3D"	1256	2220	"2008-08-18 13:24:41.111"	"172.16.0.10"	"RECEIVED: CAPA"
    "POP3D"	1256	2220	"2008-08-18 13:24:41.111"	"172.16.0.10"	"SENT: -ERR Invalid command in current state."
    "POP3D"	1256	2220	"2008-08-18 13:24:44.366"	"172.16.0.10"	"RECEIVED: USER "
    "POP3D"	1256	2220	"2008-08-18 13:24:44.366"	"172.16.0.10"	"SENT: +OK Send your password"
    "POP3D"	1256	2220	"2008-08-18 13:24:44.376"	"172.16.0.10"	"RECEIVED: PASS ***"
    "POP3D"	1256	2220	"2008-08-18 13:24:44.376"	"172.16.0.10"	"SENT: +OK Mailbox locked and ready"
    "POP3D"	1256	2220	"2008-08-18 13:24:44.386"	"172.16.0.10"	"RECEIVED: STAT"
    "POP3D"	1256	2220	"2008-08-18 13:24:44.396"	"172.16.0.10"	"SENT: +OK 0 0"
    "POP3D"	1256	2220	"2008-08-18 13:24:44.406"	"172.16.0.10"	"RECEIVED: QUIT"
    "POP3D"	1256	2220	"2008-08-18 13:24:44.406"	"172.16.0.10"	"SENT: +OK POP3 server saying goodbye..."
    "TCPIP"	1256	"2008-08-18 13:24:44.486"	"Disconnecting socket 1576 for session 2220"
    "SMTPC"	1260	2219	"2008-08-18 13:24:44.636"	"213.123.26.151"	"RECEIVED: 250 ... Sender ok"
    "SMTPC"	1260	2219	"2008-08-18 13:24:44.636"	"213.123.26.151"	"SENT: RCPT TO:"
    "SMTPC"	1260	2219	"2008-08-18 13:24:44.666"	"213.123.26.151"	"RECEIVED: 250 ... Recipient ok"
    "SMTPC"	1260	2219	"2008-08-18 13:24:44.666"	"213.123.26.151"	"SENT: DATA"
    "SMTPC"	1260	2219	"2008-08-18 13:24:44.686"	"213.123.26.151"	"RECEIVED: 354 Enter mail, end with "." on a line by itself"
    "SMTPC"	1260	2219	"2008-08-18 13:24:44.686"	"213.123.26.151"	"SENT: [nl]."
    "SMTPC"	1260	2219	"2008-08-18 13:24:44.857"	"213.123.26.151"	"RECEIVED: 250 CMQ66278 Message accepted for delivery"
    "SMTPC"	1260	2219	"2008-08-18 13:24:44.857"	"213.123.26.151"	"SENT: QUIT"
    "SMTPC"	1260	2219	"2008-08-18 13:24:44.877"	"213.123.26.151"	"RECEIVED: 221 c2beaimr02.btconnect.com closing connection"
    "TCPIP"	1260	"2008-08-18 13:24:44.877"	"Disconnecting socket 1620 for session 2219"
    

    I'll e-mail you from another address.

    Best regards,

    Robin.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.