Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# socket connection with C++ program

Status
Not open for further replies.

lumstar

Technical User
Jan 29, 2002
177
CA
Hi there,

I have a C# program (We'll call it server) using a TCPListener to accept connections. I am trying to connect to the socket using a from a C++ program (We'll call it client). (Not Visual C++ or .Net, it is compiled in gcc 2.8).

Whenever I try to connect to the server fro mthe client I get a connection refused message. How do I setup a C# socket to accept connections from other languages. The C# server works fin when I connect to it from a C# client.

Please let me know if i have been unclear or if more information is needed.

Thanks in advance,



Lumstar
______________________________________
And The Star Continues To Shine....
 
This should work. I do it all the time at work (back-end in C++, UI in C#).

I suspect that your Socket object isn't being Disposed of properly, so you're having to wait for the garbage collector to run to re-open that port. Make sure you call .Dispose() on it when you close it.

Chip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 
My problem was that it wasn't a Winsock Socket. It was a UNIX socket. I got it working. Thanks for the help.

Lumstar
______________________________________
And The Star Continues To Shine....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top