Questions tagged [sdl-net]

This is a small sample cross-platform networking library, with a sample chat client and server application. The chat client uses the GUIlib GUI framework library.

This is a small sample cross-platform networking library, with a sample chat client and server application. The chat client uses the GUIlib GUI framework library.

27 questions
3
votes
1 answer

SDL_net UDP Packet data

I'm new to network programming. I've done a little bit with TCP sockets, and I'm trying my had at a simple UDP client(s)/server. I'm using the SDL_net framework for this project. The issue I'm running into is the UDPpacket struct uses Uint8 * as…
pocket86
  • 33
  • 6
3
votes
1 answer

SDL_net 2.0 multithreading

Is it safe to call SDL_net functions on another thread (other than the main thread)? And are there any rules about it? I could not find any information about it when I searched for it.
Erik W
  • 2,590
  • 4
  • 20
  • 33
3
votes
2 answers

Converting an int to void *data and getting the length in bytes

I am trying to use the SDLNet_TCP_Send(TCPsocket sock, void *data, int len) function (part of the SDL_net library) and I am having a hard time figuring out how I could use this to send an int. Would I be able to do that or should I use another…
luddbro
  • 85
  • 13
2
votes
1 answer

sdl_net The application was unable to start correctly (0xc000007b)

I'm trying to compile and run the following code: #include #include #include #include using namespace std; int main(int argc, char **argv) { printf("result of SDL_Init is:…
boxcartenant
  • 271
  • 2
  • 14
2
votes
0 answers

Multiple reads from non-blocking SDLNet_TCP_Recv

In my single-threaded app I use SDLNet_CheckSockets -> SDLNet_SocketReady -> SDLNet_TCP_Recv chain in order to receive packets without blocking. I use 512 as the buffer size when calling SDLNet_TCP_Recv. And most of the time packets fit well into…
aesca
  • 19
  • 4
2
votes
1 answer

sdl_net udp server setup

I've looked at tutorials and many other places on how to do this however I'm still having trouble getting this to work. Interestingly enough I did find a tutorial (which is where I derived this code from) on how to setup a UDP chat program which…
user3440251
  • 33
  • 2
  • 8
1
vote
1 answer

Timeout for SDLNet_TCP_Recv?

Is there any way to cancel a SDLNet_TCP_Recv call after some time when no answer arrives? Or are there alternatives to this function that support a timeout option?
user11914177
  • 885
  • 11
  • 33
1
vote
2 answers

Link SDL2_net with CMake

I'm trying to link SDL2_net (SDL_net 2.0) to my project via CMake, but after searching around I've yet to find a solution. My CMakeLists.txt currently looks like this: 1 cmake_minimum_required (VERSION 3.7) 2 project (SDL_net_test) 3 include…
Newbyte
  • 2,421
  • 5
  • 22
  • 45
1
vote
0 answers

It is possible to download files via HTTP/HTTPS using SDL_Net?

I'm making an SDL2/OpenGL game with big assets. Some platforms, like android, limit app package size hard, so I want to download them separately. I'll also meet this issue when try to make downloadable content. I want to make game as portable as…
val - disappointed in SE
  • 1,475
  • 3
  • 16
  • 40
1
vote
1 answer

Can' t add TCP socket to a socket set with SDL_NET

I get this error trying to add my socket to a socket set: Exception thrown at 0x69702631 (SDL2_net.dll) in PROJECTNAME.exe: 0xC0000005: Access violation reading location 0x00000000. I am not sure what I am missing. Here is the relating…
1
vote
0 answers

Is there a way to use TLS with sdl_net?

I need to send an email with a gmail account in C++. This email will contain text and also attachments. Right now i'm using sdl_net to deal with socket on multiple platform but i have to work with TLS to send the email. So my question is, is there…
Corentin F
  • 47
  • 1
  • 5
1
vote
0 answers

Accessing array pointer in Header file?

By attempting to access the TCPSocket inside my "clientArray" I get a Access Violation error. How would I access it properly? My header file holds the TCPSocket *clientArray. public: TCPsocket *clientArray; SDLNet_SocketSet aSocketSet; bool…
Antsuw
  • 37
  • 5
1
vote
0 answers

SDLNet sending structs with vectors segFault

I am currently working in making a game with online, a simple game, my first time with SDLNet. I was thinking on each client sending structs with the position to the server and the server handle sending it to the others clients. The problem comes…
1
vote
1 answer

UDP datagram is being split on space character

I am trying to get my head into SDLnet and I am encountering a problem where any UDP packets that I send from the client to the server are being broken up on the space character. I can't see any reason for this happening as I am not explicitly…
user4150252
0
votes
1 answer

How to send large chunks of data using a tcp connection

I am curently trying to add a multiplayer system to my game engine. To do so i decided to use the TCP approch. Since i am already using the SDL2 library i decided to use the SDL2-net library for networking. I wish to send data to the server and vice…
1
2