Windows CE ActiveSync TCP connection - c#-2.0

I have a .NET compact framework program that has my CE device open a socket to my PC over the USB cable's ActiveSync connection. Everything works fine, except when I'm trying to use a laptop that isn't connected to a network. Then the CE device throws a SocketException with an ErrorCode = 10061, which I tracked down as a WSAECONNREFUSED -- Connection refused error.
After a bit of debugging, I discovered that the exception was being thrown because the DNS lookup (using System.Net.Dns.GetHostEntry) was only returning a Loopback... and, obviously, the CE device isn't running the server code to accept the connection...
So, any ideas on how I could: a) trick my computer into thinking it's on a network, b) reference the machine a CE device is connected to via ActiveSync in a manner other than by its hostname, or c) some other option I don't know about yet?

Don't use the hostname to resolve the PC. Instead use 'ppp-peer'.

Related

Connecting to a remote instance of Interbase on Android using IBLite not working

In Delphi 10.4.1 I'm trying to build an Android application that connects to an instance of Interbase running on my laptop (which I can connect to remotely from my desktop). I get the exception:
Project Project6.apk raised exception class EIBNativeException with message '[FireDAC][Phys][IBLite]Unable to complete network request to host "192.168.1.58".
Failed to locate host machine.
Undefined service gds_db/tcp.'.
Connection Parameters:
Database=192.168.1.58:C:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\data\employee.gdb
User_Name=sysdba
Password=masterkey
DriverID=IB
Everything works fine if I connect to a local database, or run the app on Windows.
I've seen this demonstrated in XE7 (https://youtu.be/XAZQfYzvxHc?t=1384), but can't get it to work in 10.4.1.
What am I doing wrong?
If InterBase on your Windows machine is running on default instance 'gds_db', then it is probably using TCP socket on port 3050. Try changing your Android application's Database URL to the following so it includes the target 3050 port number. I am assuming that it is not automatically able to resolve 'gds_db' name on Android since the TCP socket service name is not defined on Android. On Desktop platforms like Windows, Linux, macOS, the InterBase installer updates the system services file to provide the translation of 'gds_db' name to 3050. Just providing a TCP socket port number is a failproof way to target an endpoint without need for name resolution.
Database=192.168.1.58/3050:C:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\data\employee.gdb

Can't connect remotely to my Neo4j database

I have a Neo4j database on my desktop computer that I would like to access remotely. I'm not very knowledgeable about servers/networking, but here's a list of things I've done to try to get it working:
Uncommented the dbms.connectors.default_listen_address=0.0.0.0 line in the settings, as well as dbms.connector.http.listen_address=:7474 and dbms.connector.https.listen_address=:7473
Set up a TCP/UDP port forward on my router mapping 30408 to 7473.
Reserved a static IP for my desktop (the same one that appears in the port forward).
Defined incoming firewall exceptions on my desktop for ports 7474, 7473, and 30408 for both TCP and UDP (I'm guessing the 30408 one doesn't matter, but I've been trying everything).
When I try to connect through Chrome with {public_ip}:30408, it gives ERR_EMPTY_RESPONSE (Firefox just says "The connection was reset").
I am able to successfully connect to the neo4j browser on my local network with {local_ip}:7474.
Edit: Should I look into trying to do this with SSH? I still don't know what is going wrong in the first place.

Cannot Connect to a Firebird 2.5 database remotely

I currently have a Firebird 2.5 database at a client premises, installed on a Windows 7 Pro machine (32 bit), that has multiple stations in their local network that can connect to the database, along with the local machine being able to connect with our application and IBExpert.
However, for some of our software packages, a remote connection is required (outside of the local network). This previously was working but no longer works.
When I connect with FlameRobin from my office (I'm located in a different city / different network), I receive the following error message:
IBPP::SQLException
Context: Database::Connect
Message: isc_attach_database failed
SQL Message: -923
Connection not established
Engine Code : 335544421
Engine Message :
connection rejected by remote interface.
Performing this connection attempt with IBExpert, both from my office and from other external networks fail with a same message.
However, I am getting TCP/IP communication from what I can see. Here are the details of my troubleshooting steps for the last week:
Originally, I was receiving the following error when connecting from outside the network:
"Connection not established
Connection refused by remote interface"
Since that time, we have done a restart of the router and now have the current "connection rejected by remote interface." error message.
I can telnet to the public IP through port 3050 from my office and other outside networks.
I tested port 3050 on sites like YouGetSignal.com or CanYouSeeMe.org and they appear as open.
Other ports that we communicate on publicly are open and communicating.
The site has Kaspersky antivirus installed but all tests to connect via IBExpert while Kaspersky was in sleep mode behaved the same.
Installation of Firebird 2.5 to another workstation in the same local network, pointing to port 3051 (both in Firebird.conf and in the Windows Firewall and Router) show up as being open through Telnet and CanYouSeeMe.org but again, cannot be communicated on from outside via port 3051.
IBExpert works from a workstation in the network to the server
The server currently has no entry for RemoteBindAddress in the Firebird.conf
Wireshark shows that when a connecting from outside, there are packets coming through.
The TCP/IP test in IBexpert under Communication Diagnostics for the public IP as the host and the Service show the following Test Results:
Attempt connecting to XX.YY.ZZ.AAA.
Socket for connection obtained.
Found service 'GDS_DB' at port '3050'
Connection established to host 'XX.YY.ZZ.AAA',
on port 3050.
TCP/IP Communication Test Passed!
Database path, username, and password have all been checked multiple times.
locally on the server, I've changed security of the database.FDB and the security2.FDB to have Everyone, Full Control
At this point, we have a scheduled restart of the ISP's modem happening soon, although the fact that we have full TCP/IP communication over the port makes me doubtful that this is the issue.
If anyone can lead me down any recommended next steps to debug or to any tools that are available to help in this situation, that would be greatly appreciated.
This turns out to be a networking issue. We performed the following tests:
We performed a power cycle on the ISP's modem which showed no change in behavior
We connected a laptop directly to the ISP's modem but couldn't communicate to FB even with proper port forwarding rules in place on the machine and firewall.
We ran wireshark on both sides and on connection attempts, we found many attempts to connect with retransmissions that failed.
The technical team at the client side decided to install a VPN capable router and now we're good to go. From what we found there may be some kind of ISP blocking occurring as many of the tech teams remote services were failing to connect with similar behavior.
Hopefully this post helps people in the future with remote connectivity debugging, and all of the places you can look at when you're running into this problem.

Connecting to Firebird 3

I have installed Firebird 3.0.1 on a PC and on a VM client. I installed Flamerobin on both to test the connection.
I can connect to localhost on both PC and VM using Flamerobin, so I assume the Firebird server is running on both and Flamerobin is installed on both OK
I can connect to the Firebird server on the VM from the PC and open a database Ok
From the VM I can open a database on the PC, but when I try to retrieve the server version on the PC I get an error ISC_Service_attach failed (Unable to complete network request to host).
I have no idea what the problem is given that I can open a database ok, but cannot access any of the utility services.
I am using fbclient.dll 3.0.1.32591 on both VM and PC
If you can achieve network request to server, you need to check firewall setings on server and set fb default port as inbound acceptable. If you would had same problem after that, than you probably need proper fbclient library, for FB3 on client, VM. Hope this helps.

Filezilla connection debugging

I know this question is too broad to answer, but I can't connect to a filezilla server I'm hosting.
The computer its on has a real IP address (not not).
I am allowing connections on ports 21 and 22.
I can connect from a local filezilla client over both ftp (mapped to port 21) and ftps (mapped to port 22).
Whenever I try to connect from another computer, nothing happens.
When I connect to a website hosted on the same computer (over http or https) the connection works fine.
The client just hangs and the server doesn't print any new lines, as if it has detected no connection at all.
How can I debug this problem? It seems too broad to really ask about, so how do I go about testing to improve the situation?
try telneting to the port :
telnet HOST 21
if you get any response, it should be from a ftp server.

Resources