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 - Overv

Pages: [1]
1
Feature requests / Non-deprecated OpenGL
« on: March 14, 2011, 08:13:47 pm »
Will the internals ever be updated to use non-deprecated OpenGL?

2
General / Statically linking to SFML on Ubuntu
« on: June 24, 2010, 04:35:54 pm »
If that's now how things work on Linux, are you supposed to specify SFML as a requirement to run your program?

3
Network / Handling asynchronous receive with a TCP socket
« on: June 11, 2010, 12:34:25 am »
Quote from: "Laurent"
This is the tutorial for SFML 1.2... ;)
Quote
WARNING : this is the documentation for an old version of SFML ; the documentation for the latest official release is available through the main menu


Sorry for wasting your time  :roll:

4
Network / Handling asynchronous receive with a TCP socket
« on: June 10, 2010, 11:19:10 pm »
Quote from: "Laurent"
In SFML it's Selector::GetSocketReady, not GetSocketsReady ;)


Oh, alright. Then you need to correct the tutorial :)
http://www.sfml-dev.org/tutorials/1.2/network-selector.php

5
Network / Handling asynchronous receive with a TCP socket
« on: June 10, 2010, 09:11:38 pm »
Quote from: "Laurent"
Quote
I tried using that, but VS told me GetSocketsReady doesn't exist.

Which version of SFML are you using?


SFML 1.6

The loop problem seems to be a VS2010 problem, nevermind.

6
Network / Handling asynchronous receive with a TCP socket
« on: June 10, 2010, 09:06:59 pm »
Quote from: "Laurent"
sf::Selector.


I tried using that, but VS told me GetSocketsReady doesn't exist.

Quote from: "Laurent"
Why do you need to know if you're connected?
Calling Receive on a non-blocking socket will return a useful status: Done, Error, NotReady or Error.


What if I want to check if I'm connected without sending anything? Also, making my socket non-blocking and doing the following makes the program loop infinitely.

Code: [Select]
while ( sock.Send( data, sizeof( data ) ) != sf::Socket::Done );

7
Network / Handling asynchronous receive with a TCP socket
« on: June 10, 2010, 08:39:21 pm »
Hi,

I'm currently using a thread to process a queue with asynchronous Connect and Send operations. Now I also want to make receive asynchronous. The problem with receiving however is that now it doesn't block the main program, but it blocks the asynchronous processing queue, so my socket still becomes useless until I receive something. What is the equivalent of "select" with SFML?

This is my current thread code:

Code: [Select]
void TCPThread( void* userdata )
{
TCPSocket* sock = (TCPSocket*)userdata;

while ( true )
{
if ( sock->queue.size() > 0 )
{
TCPOperation op = sock->queue[0];

switch ( op.op )
{
case 0:
sock->connected = false;
sock->connected = sock->sock.Connect( op.arg2, op.arg1, op.arg4 ) == sf::Socket::Done;
break;

case 1:
sock->sock.Send( op.arg1, op.arg3 );
break;
}

sock->queue.pop_front();
}
}
}


Also, what is the use of SetBlocking? There is no way to check if you're connected yet.

8
General / Can't link with sfml-window and sfml-graphics
« on: June 02, 2010, 08:15:10 pm »
It turned out my graphics drivers were the issue. Sorry guys.

9
General / Can't link with sfml-window and sfml-graphics
« on: May 30, 2010, 06:59:41 pm »
When I try to compile the sample which demonstrates sleep and only requires sfml-system, it works fine:

Code: [Select]
overv@overv-desktop:~/Development/SFMLTest$ g++ -c main.cpp
overv@overv-desktop:~/Development/SFMLTest$ g++ -o main main.o -lsfml-system
overv@overv-desktop:~/Development/SFMLTest$ ./main
1.96032e-06
0.500192
1.00028
1.50035
2.00042
2.5005
3.00058
3.50065
4.00073
4.50081


However, as soon as I start linking with sfml-window, I'm getting a segfault:

Code: [Select]
overv@overv-desktop:~/Development/SFMLTest$ g++ -o main main.o -lsfml-window -lsfml-system
overv@overv-desktop:~/Development/SFMLTest$ ./main
Segmentation fault


Are my libraries broken or have I forgotten something? This is on Ubuntu 10.04 x64.

Pages: [1]
anything