• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 793
  • Last Modified:

detach and attach socket handle?

hi,
I Implement socket(non MFC CSocket), and i want to be able
to detach the socket handle from one socket object, and attach it to a
another socket object.
how can i do it?

Best Regards,

Guy Creveld

guyc@chatscan.com







0
guy73
Asked:
guy73
  • 5
  • 3
1 Solution
 
BSoetersCommented:
What do you mean by "detaching" and "attaching" ? AFAIK, socket handles are integer values, given out upon "socket()" calls, and returned when the specific socket is closed and shutdown.

Are you saying that you'd want to "rename" a socket ?
0
 
guy73Author Commented:
i mine that if i create socket handle with socket() in one thread and now i want to give this handle to another thread.
0
 
BSoetersCommented:
I'm still not sure what you want to do, could you elaborate a little bit more ?

Is it a question of communicating a socket handle to another thread ?

If that's the case, your question really is about inter process communication.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
guy73Author Commented:
you can look on the attach and detach function in CSocket in MFC, i want to be able to do the same thing with out mfc.
0
 
BSoetersCommented:
I think, at this moment, I'm not able to help you further. Perhaps you could take a look at the MFC source code for Attach() and Detach().
0
 
BSoetersCommented:
Hmm, guy73, I did not resolve your problem, therefor, I do not deserve your points. I don't know why my previous comment was posted as an answer, but I did not intended it to be an answer.

Please, if you wish, I'll place a question for 150 points in the C++ topic area. You could then answer my question and get your 150 points back. Just tell me if you want me to do that.

The question ofcourse, would be a mere comment, stating that I intend to refund your points.

If on the other hand, this really is what you needed... Please let me know how you perceive this.

Regards, Bob
0
 
guy73Author Commented:
Thank bob, but this is ok.
I did something like mfc.

0
 
BSoetersCommented:
Ok, thx, and glad I could help then :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now