Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / DarkNet sendTCP no blocking then delete packet, race condition?

Author
Message
andrewp
13
Years of Service
User Offline
Joined: 7th Sep 2010
Location:
Posted: 9th Mar 2011 01:24
Hi

I'm using DarkNet in C# I've made this function, it sends a message to all the clients in the channel. I'm wondering, seems I've set it to not block until the message is sent, if I then delete the packet afterwards, is it going to do something bad in the case the packet hasn't completley sent to all clients?

knxrb
FPSC Tool Maker
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 13th Mar 2011 02:46 Edited at: 13th Mar 2011 02:47
I would imagine that when you call the SendTCP command DarkNet will store the data that needs to be sent in a temporary packet variable, etc., then if you delete it it wouldn't matter.
Or it may sends the packets it's so fast that deleting it doesn't matter.

Overall I would say it's fine to do.

You'll need to contact the creator of DarkNet in the Darknet forum to get a proper answer I would imagine.

andrewp
13
Years of Service
User Offline
Joined: 7th Sep 2010
Location:
Posted: 13th Mar 2011 15:27
Thanks for the response, you're probably right and I've not had problems with my tests, but then it's the kind of problem that wouldn't happen all the time.

Where is the darknet forum? I couldn't see one on here, or on the official site. Darknet on google has a million hits that have nothing to do with it.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 13th Mar 2011 20:06
Hi, I am the developer.

You are right knxrb: its fine to do whatever you want with the packet after a non blocking SendTCP call.

With any send operation the packet gets copied to a memory location which only winsock (the networking API that DarkNet uses) has access too. This is needed because winsock requires exclusive access for the lifetime of the send operation.

There is no DarkNet forum, but you can email me (see email address on TGC profile).

knxrb
FPSC Tool Maker
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 13th Mar 2011 23:46 Edited at: 13th Mar 2011 23:46
Quote: "There is no DarkNet forum, but you can email me (see email address on TGC profile)."

Oh yeah, I was thinking of the Dark Physics and Dark AI forum for some reason .

Quote: "You are right knxrb: its fine to do whatever you want with the packet after a non blocking SendTCP call. "

Good to know, I reckoned it'd copy it somewhere.

andrewp
13
Years of Service
User Offline
Joined: 7th Sep 2010
Location:
Posted: 14th Mar 2011 23:50
Thanks for the reply. Much appreciated

Login to post a reply

Server time is: 2024-04-16 12:48:58
Your offset time is: 2024-04-16 12:48:58