Ã’scar, I'm sure everybody would like to help, but if you want an accurate answer, you will have to isolate your problem, and post a standalone compilable example that shows the bug.
Usually differences in behavior between debug and release in networking code are caused by either
1) Timing problems (i.e., race conditions)
* the order of packet arrival affects you program's logics
2) Network packet fragmentation (i.e., partial packet arrival)
* the size of packets received affects your program's behavior
3) Compiler bugs
* _usually_ triggered by complex code, try simplifying
Generally though I'd try to simplify and simplify your code until you have something that's still broken, but can be posted to this forum for review :-).
Bookmarks