Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trouble with sockets

 
Post new topic   Reply to topic    Infralution Support Forum Index -> .NET Encryptor Support
View previous topic :: View next topic  
Author Message
DaveB



Joined: 08 Feb 2011
Posts: 15

PostPosted: Mon Feb 13, 2012 7:56 pm    Post subject: Trouble with sockets Reply with quote

One of my programmers is reporting that a socket read is returning immediately with no data when he runs the encrypted version of our app (even though there has been data written to the socket from another application).

We are using .Net 3.5, and he is using TCPClient and TCPListener for managing socket traffic. I have not had a chance to troubleshoot this myself, but before I do I want to know if there are known issues in this area?

The socket read works fine when using the non-encrypted version of the app.
Thanks,
Dave
_________________
Dave
Back to top
View user's profile Send private message
DaveB



Joined: 08 Feb 2011
Posts: 15

PostPosted: Mon Feb 13, 2012 8:02 pm    Post subject: clarification Reply with quote

After speaking further with the programmer, it seems that the encrypted app is doing the socket write, and it's the other app that is reading zero bytes from the socket.

So, he is guessing that the encrypted version of our app is somehow failing to write the bytes to socket.

Any ideas?
_________________
Dave
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Feb 13, 2012 10:20 pm    Post subject: Reply with quote

There are no known issues with using sockets. I think it is unlikely that the encryption is causing this problem - but anything is possible. You should be able to build a debug version of your bootstrapper and debug the problem to see exactly what is occurring.

If you can manage to isolate the problem in a small test project would be happy to look at it.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
DaveB



Joined: 08 Feb 2011
Posts: 15

PostPosted: Wed Feb 15, 2012 3:46 pm    Post subject: problem found Reply with quote

You were right, it had nothing to do with sockets.
Here is the offending code:

Assembly assembly = Assembly.GetExecutingAssembly();
DateTime buildDate = File.GetCreationTime(assembly.Location);

...assembly.Location is an empty string when we run the deployed (encrypted) version of the app, and GetCreationTime throws an exception.
_________________
Dave
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Feb 15, 2012 9:55 pm    Post subject: Reply with quote

Since the encrypted assemblies are dynamically loaded they don't actually have a location - so you have to be careful about calls to assembly.Location. You could possibly replace this with:

Code:
Assembly assembly = Assembly.GetEntryAssembly();
DateTime buildDate = File.GetCreationTime(assembly.Location);


Since the entry assembly (the bootstrapper) will have a location
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> .NET Encryptor Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group