sync. sockets w/vb.net

L

Luke Balding

I'm toying with the idea of swaping out some of my C++
client and server socket programs with vb.net equivs. but
I finding that the examples included in the msdn do not
seem to interoperate with the existing C++ programs. For
example, if I use my existing C++ client app to call the
vb.net syncronous socket server example, the server
example will never accept the connection(I get an error in
the client app). But, I can telnet to the msdn server
example and I can also make the msdn vb.net client socket
example work with it. It's all pretty straight forward
sockets(ie. AF_NET, STREAM, TCP). Is there a difference
in the way that sockets are implmented with .net that I'm
missing in the documentation that I'm missing.

Also, the client is getting a wsgetlasterror() of 10061..

Thanks for any help,
Luke
 
G

George Gre

But reading your initial post again it looks that maybe its your C++ client.
Maybe you are not doing something "normal" in TCP as you think you do.

Sorry but I cannot help you further without more info (some code?).

- George.
 
L

Luke Balding

G,

I found the problem. It appears the 2050 is associated
with ESF somehow and the routine I use create the ADDR_IN
calls getservbyname. It looks like b/c the port 2050 is
related to ESF somehow the PSE object was passed back as
not null and, as the logic below goes, the port was added
psin in the intel reverse byte order iso the "natural"
byte order.

pse = getservbyname(pszServ, szServType);
if (pse == NULL)
{
int err = WSAGetLastError();
s_port = _ttoi(pszServ);
if (s_port == 0)
return FALSE;
else
s_port = htons(s_port);
}
else
s_port = pse->s_port;
psin->sin_port = s_port;

Thanks for the help,

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Asynchronous Sockets in .NET 3
VB.NET and sockets 1
Slow streaming TCP sockets 1
Async Sockets 1
.net sockets 2
socket hangs 3
Difficulty with write() [Linux] and recv() [Windows] 1
Sockets 3

Top