Link to home
Start Free TrialLog in
Avatar of pointeman
pointemanFlag for United States of America

asked on

Sockets BeginConnect Pass String?

Q: Can I 'pass' a string in place of the 'null' param in the Sockets.BeginConnect method?
Q. If so, how do I retreived the string in the next method?

I generally find the state object either null or the actual socket name.

clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnConnect), null);

 private void OnConnect(IAsyncResult ar)
 {
     clientSocket.EndConnect(ar);              
     clientSocket.BeginSend(data, 0, data.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
  }
ASKER CERTIFIED SOLUTION
Avatar of Ravi Vaddadi
Ravi Vaddadi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial