Hello Yvan, It is only one memory location because it is just a typecast, no converstion is done.
Can you tell also what access violation it exacly is ? Are you calling sendStr from same thread context as the one where TWSocket is created ? --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, November 29, 2007, 23:16, Yvan Boutin wrote: > Hello, > We have a problem with an application that have 2 threads, when we try to > send 2 different messages by 2 thread using 2 instances of twSocket V5.25. > Each thread got their own socket connection. If the threads are sending at > the same time the application crash with an access violation error. > I am using the function sendstr and I notice the str parameter is declare as > constant. Then it is convert to a pointer and send to the function > PutDataInSendBuffer(Data : Pointer; Len : Integer); . It is possible that > the compiler will use only one memory location for the variable str declare > in sendstr? > Did some one have seen the behaviour ? > Thanks > Yvan > ---------------------------------------------------------------------------- > ---------------------------------------------------------------------------- > ------- > J'ai un problème lorsque que je retrouve dans une application 2 THREADS > qui envoyer des messages dans des sockets différents. Si les threads > envoient un message en même temps en utilisant 2 instances de tWSocket > j'obtient un Access violation. > J'utilise la fonction SENDSTR pour l'envois du message. > Jai cette erreur a la ligne cWritten := oBuffer.Write(Data, Len); dans > la fonction PutDataInSendBuffer(Data : Pointer; Len : Integer); Jai > remarqué que la fonction sendStr déclare le ses paramètres avec une > constance (const Str : String). Celui-ci est acheminé en pointeur a la > fonction PutDataInSendBuffer. Est-ce possible que le compilateur garde > quune seul espace de mémoire pour cette variable? > Est-ce que quelqu'un à déjà vécu cette problématique? > Merci > Yvan > Yvan Boutin > [EMAIL PROTECTED] -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be