sync. sockets w/vb.net

  • Thread starter Thread starter Luke Balding
  • Start date Start date
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
 
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.
 
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
 
Back
Top