NET2 & FE problem : lockup / access violation

Howdy folks,

i get have a problem where i keep getting : NET2_TCPACCEPTEVENT even though
my client socket which i made in delphi only connects once. i tracked down
the problem to the following piece of code :**********************

int FE_PushEvent(SDL_Event *ev)
{
SDL_LockMutex(eventLock);
while (0 >= SDL_PushEvent(ev))
{
SDL_CondWait(eventWait, eventLock);
}
SDL_UnlockMutex(eventLock);
SDL_CondSignal(eventWait);

return 1;
}


it hangs in the while loop for a while then generates the access violation.
in the mean time more NET2_TCPACCEPTEVENT events keep comming in.
What can i do to solve this problem ?
if anyone want the executable of my chatserver just tell me and i’ll mail it
so you can see the effect.

GreeTz
DV

Almost forgot to mention :
simply changing the loop into :

while (0 > SDL_PushEvent(ev))
{
SDL_CondWait(eventWait, eventLock);
}

offcourse stops it from looping, but i assume there was some purpose to
making a >= condition instead of >

GreeTz

DV

Howdy folks,

i get have a problem where i keep getting : NET2_TCPACCEPTEVENT even though
my client socket which i made in delphi only connects once.

I’m sorry, but that statement doesn’t make sense to me. If you are using
some sort of delphi socket library you cannot also use NET2. Also, that
event is only generated when a server socket accepts aconnection, never
when a client connects to a server.

If you are trying to mix’n’match libraries it isn’t going to work. The
other thing that would cause a problem like this is memory corruption.

		Bob PendletonOn Sun, 2003-04-13 at 14:43, Dinand Vanvelzen wrote:

i tracked down
the problem to the following piece of code :


int FE_PushEvent(SDL_Event *ev)
{
SDL_LockMutex(eventLock);
while (0 >= SDL_PushEvent(ev))
{
SDL_CondWait(eventWait, eventLock);
}
SDL_UnlockMutex(eventLock);
SDL_CondSignal(eventWait);

return 1;
}


it hangs in the while loop for a while then generates the access violation.
in the mean time more NET2_TCPACCEPTEVENT events keep comming in.
What can i do to solve this problem ?
if anyone want the executable of my chatserver just tell me and i’ll mail it
so you can see the effect.

GreeTz
DV


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

Almost forgot to mention :
simply changing the loop into :

while (0 > SDL_PushEvent(ev))
{
SDL_CondWait(eventWait, eventLock);
}

offcourse stops it from looping, but i assume there was some purpose to
making a >= condition instead of >

Yeah, the test is used to keep from pushing an event onto a full queue.
When you push onto a full queue the event gets dropped.

	Bob PendletonOn Sun, 2003-04-13 at 14:51, Dinand Vanvelzen wrote:

GreeTz

DV


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

Well if i leave the check like it should be then i keep getting the accept
event and after a while an access violation occures.
If i sabotage the check by making it > instead of >= everything works
fine,… the connection get established correctly and everything.
This is a bit strange because if you are correct the event should have been
dropped instead of being dispached once.

GreeTz--------------------------------
| Dinand Vanvelzen, |
| Programmer, |

Software Engineering student

----- Original Message -----
From: bob@pendleton.com (Bob Pendleton)
To: “SDL Mailing List”
Sent: Monday, April 14, 2003 8:12 PM
Subject: Re: [SDL] NET2 & FE problem : lockup / access violation

On Sun, 2003-04-13 at 14:51, Dinand Vanvelzen wrote:

Almost forgot to mention :
simply changing the loop into :

while (0 > SDL_PushEvent(ev))
{
SDL_CondWait(eventWait, eventLock);
}

offcourse stops it from looping, but i assume there was some purpose to
making a >= condition instead of >

Yeah, the test is used to keep from pushing an event onto a full queue.
When you push onto a full queue the event gets dropped.

Bob Pendleton

– Cleanup –

Well if i leave the check like it should be then i keep getting the accept
event and after a while an access violation occures.
If i sabotage the check by making it > instead of >= everything works
fine,… the connection get established correctly and everything.
This is a bit strange because if you are correct the event should have been
dropped instead of being dispached once.

Ok, sorry about that. I was depending on memory. You are using an old
version of NET2. The code you are looking at worked for an earlier
version of SDL. There was a bug in the return code for SDL_PushEvent()
and instead of making it work the way it was documented, the fix made it
work… well, the way it should have from the beginning. Since the fix
broke the old version of NET2 I updated it to match the newest versions
of SDL.

Download a new version of NET2.On Mon, 2003-04-14 at 14:28, Dinand Vanvelzen wrote:

GreeTz


| Dinand Vanvelzen, |
| Programmer, |

Software Engineering student

----- Original Message -----
From: “Bob Pendleton” <@Bob_Pendleton>
To: “SDL Mailing List”
Sent: Monday, April 14, 2003 8:12 PM
Subject: Re: [SDL] NET2 & FE problem : lockup / access violation

On Sun, 2003-04-13 at 14:51, Dinand Vanvelzen wrote:

Almost forgot to mention :
simply changing the loop into :

while (0 > SDL_PushEvent(ev))
{
SDL_CondWait(eventWait, eventLock);
}

offcourse stops it from looping, but i assume there was some purpose to
making a >= condition instead of >

Yeah, the test is used to keep from pushing an event onto a full queue.
When you push onto a full queue the event gets dropped.

Bob Pendleton

– Cleanup –


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+