hikalkan / scs

TCP Server/Client Communication and RMI Framework
MIT License
225 stars 112 forks source link

Posible concurrency problema #9

Open gfazzola opened 9 years ago

gfazzola commented 9 years ago

Hello Halil. I think I found a possible bug in the TcpCommunicationChannel SendMessageInternal class method. The method begins with // Send message              totalSent var = 0;              lock (_syncLock)              { .....

totalSent + = sent;              }

The problem I see is that the variable totalSent is out of lock which if you were using several processes other could enter the method, initialize the variable to zero, modifying the value of the same that is used to complete the loop (below .... totalSent + = sent; )

I have not tested to confirm it but I think it is possible.

Greetings from Argentina!!