31
Network / Packet Send - Fragmentation?
« on: December 10, 2008, 07:26:27 pm »
So I don't have to care about this? Thats great...
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.
sf::SocketTCP sock; //(this will be properly initialized)
sf::Packet p;
Uint32 length = 0;
sf::Clock clock;
sf::Socket::Status sstate;
sock.SetBlocking(false);
do
{
sstate = sock.Receive(p);
if(sstate == Socket::NotReady)
{
Sleep(0.05f);
continue;
}
else if(sstate == Socket::Done)
{
if(!length) //we do not have a length value now
{
if(p.GetDataSize() > 4) //can we read 32 bit?
{
p >> length; //will this decrease the "GetDataSize()" value by 4???????
}
}
else
{
if(p.GetDataSize() < length)
{
continue;
}
else if(p.GetDataSize() > length) throw 1; /*error - what happens with 2 packets sent with VERY low time gap? With packets send at the same time?*/
else break; // we have collected all the data and nothing MORE
}
}
else throw 1; //error
}
while(clock.GetElapsedTime() < 5.f); //Timeout
musics[fname] = new Music;
musics[fname] = (Music*)123;
in the line before, and this does NOT lead to an Access violation.
//Given an instance of sf::RenderWindow (hereafter called app)
const Input& i = app.GetInput();
Vector2i mousePositionRelative(i.GetMouseX(),i.GetMouseY());
//Fills a Vector2i (2 integer values) with the mouse position which is returned as int
sudo make install
Makefile:5: *** missing separator. Schluss.
The call to Open or OpenFromMemory actually doesn't start the music, only a call to Play does.