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

Author Topic: SFNUL  (Read 58162 times)

0 Members and 1 Guest are viewing this topic.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFNUL
« Reply #60 on: April 12, 2015, 11:26:08 am »
Yeah, I'd love to, just couldn't find any solution, so I just sadly accepted the fact that windows version of github has its charms

fatal: 'submodule' appears to be a git command, but we were not
able to execute it. Maybe git-submodule is broken?

I've found some questions about it, no solution though.
The reason is simple: Because there is no solution. :P Seriously though, don't use GitHub's program, whatever it's called. If you even bother with git, use it directly. You won't end up with strange problems such as these.

http://tehsausage.com/mingw-to-string
Well, it seems to have worked for me
You do realize that that "patch" is for 4.7.0 right? As in... the version that might not have fully supported C++11 yet? Since you are using 4.9.2, you are doing nothing else but breaking a working installation by applying random patches such as these. Just... don't do it. Never ever modify your toolchain installation. If something doesn't work, it has either been fixed or implemented in a newer version of the toolchain, so upgrading it is the only sane solution.

Yeah, I'll start with reinstalling MinGW and/or building with another version.
SFNUL builds on MinGW 4.9.2, there is no reason to try with another version. Like I said, solve the git problem first and work from there.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11028
    • View Profile
    • development blog
    • Email
Re: SFNUL
« Reply #61 on: April 12, 2015, 12:03:36 pm »
For the lazy people here's a simple batch file that will build SFNUL as static libs in debug and release mode.

Prerequisites:
git clone https://github.com/binary1248/SFNUL.git
cd SFNUL
git submodule update --init --recursive
mkdir build
cd build
cmake -G"MinGW Makefiles" -DSFNUL_USE_STD_THREAD=TRUE -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Debug -DSFNUL_BUILD_EXAMPLES=FALSE ..\
mingw32-make install -j8
cmake -G"MinGW Makefiles" -DSFNUL_USE_STD_THREAD=TRUE -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Release -DSFNUL_BUILD_EXAMPLES=FALSE ..\
mingw32-make install -j8

The builds can finally be found in the SFNUL/install directory.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Zax37

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: SFNUL
« Reply #62 on: April 12, 2015, 03:05:06 pm »
I uninstalled GitHub, installed Git and everything worked as charm!

Thank You both, gentlemen! :)

spacechase0

  • Newbie
  • *
  • Posts: 39
    • AOL Instant Messenger - thespacechase0
    • View Profile
    • http://spacechase0.com/
Re: SFNUL
« Reply #63 on: April 25, 2015, 06:36:24 am »
While this might just be because I'm oblivious sometimes, I think a warning here would be useful. I was using HTTPClient and I spent a couple hours trying to figure out why the server was "ignoring" my request (uploading multiple MB files) and just got stuck forever. (Or did I miss a way to check for non-HTTP errors within HTTPClient/HTTPResponse?)

I'm still having some other issues with large-ish requests, but I want to try another thing or two for that.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFNUL
« Reply #64 on: April 25, 2015, 10:31:24 am »
https://github.com/binary1248/SFNUL/blob/7e1f198dcc0445746a1a5aea7d350412aad27c92/include/SFNUL/Utility.hpp#L29
https://github.com/binary1248/SFNUL/blob/7e1f198dcc0445746a1a5aea7d350412aad27c92/examples/TestClient.cpp#L341
https://github.com/binary1248/SFNUL/blob/7e1f198dcc0445746a1a5aea7d350412aad27c92/examples/TestServer.cpp#L391
;D

The "problem" if you can even call it that, is that there currently is no "general documentation" location. All documentation is contextual since it is written as part of the header files. I didn't feel like adding a note about the block size setting to every single class since I figured anybody willing to use the library would eventually stumble into it themselves. I guess you eventually did ;D.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Peb

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re : SFNUL
« Reply #65 on: August 31, 2015, 12:42:32 pm »
Hello, and congratz for this amazing library !  :)

Unfortunately I get a post-compilation problem (linking), when I compile my project using your library.

My version of gcc is : gcc version 4.9.2 (x86_64-posix-seh-rev3, Built by MinGW-W64 project)

Here is the report :

Quote
[100%] Building CXX object CMakeFiles/server.dir/code/Server.cpp.obj
Linking CXX executable ..\bin\server.exe
D:\C++\SFNUL\lib\libsfnul-s.a(TcpListener.cpp.obj):TcpListener.cpp:(.text$_ZN3sfn11TcpListener15TcpListenerImpl13AcceptHandlerERKSt10error_codeSt10shared_ptrIN4asio19basic_stream_socketINS6_2ip3tcpENS6_21stream_socket_serviceIS9_EEEEE[_ZN3sfn11TcpListener15TcpListenerImpl13AcceptHandlerERKSt10error_codeSt10shared_ptrIN4asio19basic_stream_socketINS6_2ip3tcpENS6_21stream_socket_serviceIS9_EEEEE]+0x8cb): undefined reference to `AcceptEx'
D:\C++\SFNUL\lib\libsfnul-s.a(TcpListener.cpp.obj):TcpListener.cpp:(.text$_ZN4asio6detail25win_iocp_socket_accept_opINS_12basic_socketINS_2ip3tcpENS_21stream_socket_serviceIS4_EEEES4_NS0_15wrapped_handlerINS_10io_service6strandESt5_BindIFZN3sfn11TcpListener15TcpListenerImpl13AcceptHandlerERKSt10error_codeSt10shared_ptrINS_19basic_stream_socketIS4_S6_EEEEUlSt8weak_ptrISD_ESH_SL_E_SN_St12_PlaceholderILi1EESL_EEEEE11do_completeEPNS0_19win_iocp_io_serviceEPNS0_18win_iocp_operationESH_y[_ZN4asio6detail25win_iocp_socket_accept_opINS_12basic_socketINS_2ip3tcpENS_21stream_socket_serviceIS4_EEEES4_NS0_15wrapped_handlerINS_10io_service6strandESt5_BindIFZN3sfn11TcpListener15TcpListenerImpl13AcceptHandlerERKSt10error_codeSt10shared_ptrINS_19basic_stream_socketIS4_S6_EEEEUlSt8weak_ptrISD_ESH_SL_E_SN_St12_PlaceholderILi1EESL_EEEEE11do_completeEPNS0_19win_iocp_io_serviceEPNS0_18win_iocp_operationESH_y]+0xfd): undefined reference to `GetAcceptExSockaddrs'
D:\C++\SFNUL\lib\libsfnul-s.a(TcpListener.cpp.obj):TcpListener.cpp:(.text$_ZN4asio6detail25win_iocp_socket_accept_opINS_12basic_socketINS_2ip3tcpENS_21stream_socket_serviceIS4_EEEES4_NS0_15wrapped_handlerINS_10io_service6strandESt5_BindIFZN3sfn11TcpListener15TcpListenerImpl13AcceptHandlerERKSt10error_codeSt10shared_ptrINS_19basic_stream_socketIS4_S6_EEEEUlSt8weak_ptrISD_ESH_SL_E_SN_St12_PlaceholderILi1EESL_EEEEE11do_completeEPNS0_19win_iocp_io_serviceEPNS0_18win_iocp_operationESH_y[_ZN4asio6detail25win_iocp_socket_accept_opINS_12basic_socketINS_2ip3tcpENS_21stream_socket_serviceIS4_EEEES4_NS0_15wrapped_handlerINS_10io_service6strandESt5_BindIFZN3sfn11TcpListener15TcpListenerImpl13AcceptHandlerERKSt10error_codeSt10shared_ptrINS_19basic_stream_socketIS4_S6_EEEEUlSt8weak_ptrISD_ESH_SL_E_SN_St12_PlaceholderILi1EESL_EEEEE11do_completeEPNS0_19win_iocp_io_serviceEPNS0_18win_iocp_operationESH_y]+0x369): undefined reference to `AcceptEx'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\server.dir\build.make:191: recipe for target '../bin/server.exe' failed
mingw32-make[2]: *** [../bin/server.exe] Error 1
CMakeFiles\Makefile2:59: recipe for target 'CMakeFiles/server.dir/all' failed
mingw32-make[1]: *** [CMakeFiles/server.dir/all] Error 2
makefile:75: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

I'm using the static version of SFNUL compiled with the script found on a previous post (the one with Git).

Here is my CMakeLists.txt :

Quote
cmake_minimum_required( VERSION 2.8 )
set( ROOTDIR ${CMAKE_SOURCE_DIR} )
set( CMAKE_MODULE_PATH ${ROOTDIR}/cmake/modules )
set( EXECUTABLE_OUTPUT_PATH ${ROOTDIR}/bin )
add_definitions( -static-libgcc -static-libstdc++ -Wfatal-errors -std=c++11 -fpermissive -municode )
file( GLOB_RECURSE source_files code/* )
set( SFNUL_STATIC_LIBRARIES TRUE )
find_package( SFNUL REQUIRED )
include_directories( ${ROOTDIR}/code ${SFNUL_INCLUDE_DIR} )
add_executable( server ${source_files} code/Server.cpp )
target_link_libraries( server ${SFNUL_LIBRARY} ${SFNUL_DEPENDENCIES} )

What am I doing wrong ?
« Last Edit: August 31, 2015, 12:47:28 pm by Akaros »

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFNUL
« Reply #66 on: August 31, 2015, 05:02:37 pm »
You aren't doing anything wrong. ;D

I added the missing mswsock library to FindSFNUL.cmake. If you grab the newest revision it should be fixed there.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Peb

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFNUL
« Reply #67 on: August 31, 2015, 05:27:51 pm »
It's working now, thanks man !  :D

silverweed

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: SFNUL
« Reply #68 on: September 02, 2015, 11:38:38 am »
This looks really cool...makes me want to add multiplayer to the game I'm making just to try this library  ::)

AlexxanderX

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • AlexanderX
Re: SFNUL
« Reply #69 on: December 16, 2015, 09:35:10 pm »
Nice library. I decided to use SFNUL in my new tableboard multiplayer mini game, but I need some help. I firstly used SFML and then decided to use SFNUL because of the relief of code the library offer. In my LAN server overview window I used sf::UdpSocket with sf::AnyPort to send a package to all servers on network using sf::IpAddress::Broadcast and the port of the server, then the server would send back the a package so the client would know that at that ip is a server. Now that I switched to SFNUL I don't know how to do same thing. The Bind() function require a ip address and a port, not just the port and also how to send a message to the network because I can't find a function to get the broadcast ip address( EDIT: I think it is 0.0.0.0).
Here you can find my blog and tutorials about SFML - http://alexanderx.net/ (died...) - http://web.archive.org/web/20160110002847/http://alexanderx.net/

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11028
    • View Profile
    • development blog
    • Email
SFNUL
« Reply #70 on: December 16, 2015, 09:49:23 pm »
You might want to read up a bit on networking and/or look at the SFML implementation. ;)
There are official UDP broadcast IP addresses.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFNUL
« Reply #71 on: December 16, 2015, 10:00:33 pm »
You can bind to whatever address you want to bind to. 0.0.0.0 is AnyAddress in SFML, but this naming can be a bit ambiguous because it doesn't just select a single address out of multiple possible addresses, it actually binds to all addresses.

As for broadcasting, like eXpl0it3r said, you need to know what you actually want to achieve. There are many different ways to broadcast. Depending on your network parameters you also need to select the proper broadcast domain. Once you have the broadcast address, it is just a matter of sending data to that address. It doesn't target a single host in the usual manner but a whole domain.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

AlexxanderX

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • AlexanderX
Re: SFNUL
« Reply #72 on: December 17, 2015, 11:39:42 am »
After I read on internet on the broadcast ip address and how to calculate it I tested on the precalculated broadcast ip address of my ip address and worked :D . Now the question is: what is the best way to get the local ip and mask? Should I include and use asio or is a better way? ( If asio is the way, should use the version that come with SFNUL? I found in the SFNUL's cmake file that the include path is included but leave out the sources, or maybe he is just a dependency of a dependency).
« Last Edit: December 17, 2015, 11:42:22 am by AlexxanderX »
Here you can find my blog and tutorials about SFML - http://alexanderx.net/ (died...) - http://web.archive.org/web/20160110002847/http://alexanderx.net/

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFNUL
« Reply #73 on: December 17, 2015, 12:31:55 pm »
There is no best way to get all of your local interface addresses, there is no portable way at all, not even with ASIO. Applications normally either just bind to 0.0.0.0 by default, or let the user specify an address to bind on (because they should normally know this themselves). Any way to programatically find out all your interface addresses would be very platform specific and have to be implemented on each platform you want to support.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

AlexxanderX

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • AlexanderX
Re: SFNUL
« Reply #74 on: December 17, 2015, 03:18:04 pm »
Thanks for help. One more question: how can I debug the code: I want to say that SFML would return a Status and I would check if the command executed was successfully or not and from what I see in SFNUL the functions return nothing( maybe because they run in thread and do not execute immediately).
Here you can find my blog and tutorials about SFML - http://alexanderx.net/ (died...) - http://web.archive.org/web/20160110002847/http://alexanderx.net/

 

anything