Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

detach and attach socket handle?

Posted on 2000-04-24
8
Medium Priority
?
752 Views
Last Modified: 2012-06-21
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
Comment
Question by:guy73
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 1

Expert Comment

by:BSoeters
ID: 2747331
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
 

Author Comment

by:guy73
ID: 2749043
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
 
LVL 1

Expert Comment

by:BSoeters
ID: 2749186
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:guy73
ID: 2756643
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
 
LVL 1

Accepted Solution

by:
BSoeters earned 150 total points
ID: 2784024
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
 
LVL 1

Expert Comment

by:BSoeters
ID: 2788696
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
 

Author Comment

by:guy73
ID: 2821535
Thank bob, but this is ok.
I did something like mfc.

0
 
LVL 1

Expert Comment

by:BSoeters
ID: 2823125
Ok, thx, and glad I could help then :)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question