Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Unicode

Pages: [1]
Network / Re: TcpSocket connect on Android does not behave correctly
« on: June 03, 2024, 10:27:20 pm »
My setup is fairly simple:
- My Anroid tablet using the c++ compiler app CxxDroid running the above code with SFML-2.5.1 preinstalled (no setup at all apart from installing the app)
- My Windows PC using a basic set up Visual Studio 2022 project with SFML-2.6.1 linked, etc., running the exact same (already mentioned) code
Should I go more into detail about my PC setup? Because everything works there. It is just Android that's wierd and I just have it as a reference :).

Yeah I know about NAT loopback, which is why I connect my tablet to a hotspot from my phone and try to connect to my home routers Ip (so there should be two different networks in play here).
I will have a look at wireshark again, but I am wondering (also regarding NAT loopback), if it even makes sense to check those. I mean better safe than sorry but is there something about the Tcp connect method that is so different from all the other networking stuff to not be working because of these? Asking since nothing else has problems and isn't the TcpSocket with its connect() method using the same stuff the other networking features use? (I know what TCP is and what it does. I hope you get my point.)

Again thanks for helping me here!
(Offtopic: And while already talking to one, if not *the* head of SFML: I love what you all have built here. SFML is such a great library, thanks for developing and taking care of it! I hope I someday will be able to contribute something and help :).)

Network / Re: TcpSocket connect on Android does not behave correctly
« on: June 02, 2024, 08:04:05 pm »
Thanks a lot!

Yeah I've had a look into both. The manifest and everything else is pretty much hidden and generated by the compiler App behind the scene. All one does to code a SFML program is to include it and write code for it. No set up or anything required, but therefore also not accessible.
Wireshark also just confirms that nothing actually leaves the device. The TcpSocket seems to decide when seeing my routers ip: Nope, (almost) every other Ip is fine but this one, naah.

I don't think some other permissions or requirements are the problem either, since it perfectly works with the UdpSocket, the TcpListener and the TcpSocket itself even, though just not when calling the connect() method on a (my) public Ip.

I also couldn't find any other post about this issue, although some have mentioned not being able to connect to public Ips via Tcp. Sadly these threads don't go to much into detail and are left abandoned after a short amount of time.

Could I somehow see where the status Disconnected comes from exactly? I could only pinpoint it down to the two calls ::connect() and select() in the TcpSocket connect() method but can't find where those themselves are coming from.

Network / TcpSocket connect on Android does not behave correctly
« on: June 01, 2024, 02:08:09 pm »
Hello everybody!
Working with the TcpSocket for some time now, I encountered a couple of problems using it. I think I will make new posts for the other ones in the future, but this one is really wierd and makes it kind of unusable.

Whenever I initialize a TcpSocket on Android and call its connect() method, wierd things happen. With my local ip it works just fine. It waits the specified amount of time for a connection and returns either status Error or status Done (just as you'd expect). This is the case on both Windows and Android. But with some (including my) public ips (just!) on Android, it seems to always recognize the ip as incorrectly formatted or something like that and returns status Disconnected immediately.
This is wierd because the exact same code behaves perfectly fine on Windows (and mabye other OSs), but becomes unusable on Android if you want to have it initiate a connection (the sf::TcpListener works fine too).

Minimal example (same for Android as for Windows):
#include <SFML/Networking.hpp>

int main() {
    sf::TcpSocket socket;
    socket.connect("SomePublicIp", 42069, sf::seconds(10));
    return 0;

Additional info:
I used Visual Studio 2022 and SFML-2.6.1 on Windows and the (btw SUPER convenient) App CxxDroid with SFML-2.5.1 already setup on Android. The version difference shouldn't matter since the changelog shows that only very little in the networking module changed, nothing to do with this problem I think.

Also (if it matters) I have set up port forwarding and am on different networks (one being my home router and the other one my phones mobile network). I additionally even restarted my router to get a new public Ip, but it doesn't work with this new one either. It now works (i.e. waits 10 seconds and returns status Error instead of instant status Disconnected) though with my old Ip, just as my router switched Ips! What's going on here?

Any help will be appreciated. Thanks in advance! ;D

General / Re: Help with distribution for macOS (Xcode not working)
« on: December 26, 2023, 09:10:50 pm »
Yeah looks like it, but I've done all the tutorial steps over and over again and nothing changed...
Here you go though.


General / Re: Help with distribution for macOS (Xcode not working)
« on: December 16, 2023, 10:30:45 pm »
Thanks for the reply!

Yes that would be the next step looking into signing and all of that, but for now I would just like to get a simple *working* version which would compile elsewhere.

General / Help with distribution for macOS (Xcode not working)
« on: December 15, 2023, 08:43:38 pm »

I recently had to work with macOS and sfml on it and it was a real pain until now.
My problem is that I have to distribute a macOS version of an sfml project (originally on windows) which I for some reaseon can't get to work at all.
It feels like I've searched the whole internet for a fix or any alternative but nothing seems to work and be assured, I have tried a lot. Searching in every website until google page ~10, asked all youtubers that made a tutorial on it why it won't work (most of them answered), searched through every forum I know of and tried every provided solution that may work and even tried every search engine available in my browser to mabye get some different search results. Nothing seems to fix it or in other words, no one seems to have my problem.

For an easy distribution I wanted to use Xcode, so I exactly followed all the steps on the official tutorial page (using frameworks and the app template) and ticked a checkmark in Build Phases -> Run Script (because everyone was suggesting to do that due to an error). After doing that, it worked for everyone I saw but I just got an error saying the library could not be loaded and there was "no such file" of sfml-system.
Full error (Project name is "Testing"):
(click to show/hide)
I am on a virtual machine with root access running the latest macOS.

At some point I wondered if sfml would even work on this system (I don't know why I had conerns it wouldn't) so I used cmake to generate, in this case, unix makefiles to run a small test program and with that it worked perfectly fine. Since my goal isn't to code on mac but rather just to build an already existing and running project for sending it to other mac useres (at best to be run as an out of the box and ready to use program), it really doesn't matter how I get there as long as I do so. But to ship this cmake project as out of the box, I do not really understand how I can fit the library in there or just link it statically + there are also almost no resources out there (I am kind of a noob when it comes to more advanced command line stuff).

Concluding: All I want is just a way to ship my sfml project as an out of the box application to other mac users. I would prefer Xcode since it's the more mainstream way I think but everything which does the job is perfectly fine as well.

I would really appreciate if anyone could help me out or provide a hint in which direction I could further research.

Thanks :)

Pages: [1]