Solved

Using condition function in WSAAccept

Posted on 2001-08-21
9
573 Views
Last Modified: 2007-12-19
I tried to use callback condition function in WSAAccept. I wrote the code as what MSDN told me to do. When I use WSAConnect(...) I specified the lpCallerData and left the last three parameters to be NULL. But when I use condition function on the accept side, no caller connection data could be retrieved. The lpCallerData is always NULL. Anything I haven't noticed? Please help me, thanks.
0
Comment
Question by:xutao
[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
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6411639
Have you called WSAStartup ?

Have you called bind on the socket first ?

Vin.
0
 
LVL 1

Author Comment

by:xutao
ID: 6417523
Sure.
In <<Winsock 2.0>> I found that from WSAPROTOCOL_INFO I can get whether a certain protocol support connect data exchange. So I use WSAEnumProtocols(...) to retrieve the info. On my pc I get 12 protocols' info. Then I check "WinSock Proxy [tcp]" protocol, after checking XP1_CONNECT_DATA bit of the dwServiceFlags1(in WSAPROTOCOL_INFO structure) it returns 0. So I think the protocol I use doesn't support connect data exchange. Am I right?
Then I check all the 12 protocols' dwServiceFlags1, all the return value of that bit is 0. Any one ever used connect data exchange in socket programming? Any suggestion?
0
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6417664
I think you also need to give a pointer to the user data that is to be transferred back from the other socket during connection establishment. i.e.

int  WSAConnect(
  SOCKET s,                          
  const struct sockaddr FAR *name,  
  int namelen,                      
  LPWSABUF lpCallerData,            
  LPWSABUF lpCalleeData,            
  LPQOS lpSQOS,                      
  LPQOS lpGQOS                      
);

lpCalleeData must also be specified.

Vin.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:xutao
ID: 6421704
I've tried but it does nothing.
0
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6422325
So on the connect side you populate a WSABUF structure ?

Vin.
0
 

Expert Comment

by:amp072397
ID: 6789693
xutao:

You have asked 21 questions here at EE, and you have only resolved 3 of them. Here is a list of your open questions. I will be posting this comment in all of them.

http://www.experts-exchange.com/jsp/qShow.jsp?ta=winntnet&qid=20154615
http://www.experts-exchange.com/jsp/qShow.jsp?ta=networkgen&qid=20154616
http://www.experts-exchange.com/jsp/qShow.jsp?ta=networkgen&qid=20160832
http://www.experts-exchange.com/jsp/qShow.jsp?ta=networkgen&qid=20168293
http://www.experts-exchange.com/jsp/qShow.jsp?ta=networkgen&qid=20171676
http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=11217097
http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=11872498
http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20133253
http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20133912
http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20171681
http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20171684
http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20248551
http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20248764
http://www.experts-exchange.com/jsp/qShow.jsp?ta=winprog&qid=20252102
http://www.experts-exchange.com/jsp/qShow.jsp?ta=winprog&qid=20254933
http://www.experts-exchange.com/jsp/qShow.jsp?ta=winprog&qid=20255719
http://www.experts-exchange.com/jsp/qShow.jsp?ta=winprog&qid=20258375

To assist you in your cleanup, I'm providing the following guidelines:

1.  Stay active in your questions and provide feedback whenever possible. Likewise, when feedback has not been provided by the experts, commenting again makes them receive an email notification, and they may provide you with further information. Experts have no other method of searching for questions in which they have commented, except manually.

2.  Award points by hitting the Accept Comment As Answer button located above and to the left of that expert's comment.

3.  When grading, be sure to read:
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp#3
to ensure that you understand the grading system here at EE. If you grade less than an A, you must explain why.

4.  Questions that were not helpful to you should be PAQ'd (stored in the database for their valuable content?even if not valuable to you) or deleted. To PAQ or delete a question, you must first post your intent in that question to make the experts aware. Then, if no experts object after three full days, you can post a zero-point question at community support to request deletion or PAQ. Please include the link(s) to the question(s).
CS:  http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
At that point, a moderator can refund your points and PAQ or delete the question for you. The delete button does not work.

5.  If you fail to respond to this cleanup request, I must report you to the Community Support Administrator for further action.

Our intent is to get the questions cleaned up, and not to embarrass or shame anyone. If you have any questions or need further assistance at all, feel free to ask me in this question or post a zero-point question at CS. We are very happy to help you in this task!


thanks!
amp
community support moderator

0
 
LVL 1

Author Comment

by:xutao
ID: 6791636
Sure.
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6805772
Note sent today to Admin re: remaining open questions.

Netminder
Community Support Moderator
Experts Exchange
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 6834943
Admin notified of user neglect. Points refunded and question closed.

Netminder
Community Support Moderator
Experts Exchange
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

734 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