By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,201 Members | 922 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,201 IT Pros & Developers. It's quick & easy.

sync. sockets w/vb.net

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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.
"Luke Balding" <lb******@nackware.com> wrote in message
news:76****************************@phx.gbl...
Thanks for the quick reply. Both the C++ client and
vb.net server are on the same machine. the server is
listening on 127.0.0.1 2050 and the client tries to
connect to it on the same address..

Luke
-----Original Message-----
Hi,

I have receintly made a c# tcp server, having c++ clients

connected to it
with no problems.

Are you trying to connect from another PC ? Have you got

more than one TCP
adapters installed on you PC?

-George.

"Luke Balding" <lb******@nackware.com> wrote in message
news:07****************************@phx.gbl...
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

.

Jul 19 '05 #2

P: n/a
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
-----Original Message-----

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.
"Luke Balding" <lb******@nackware.com> wrote in message
news:76****************************@phx.gbl...
Thanks for the quick reply. Both the C++ client and
vb.net server are on the same machine. the server is
listening on 127.0.0.1 2050 and the client tries to
connect to it on the same address..

Luke
>-----Original Message-----
>Hi,
>
>I have receintly made a c# tcp server, having c++ clients
connected to it
>with no problems.
>
>Are you trying to connect from another PC ? Have you
got more than one TCP
>adapters installed on you PC?
>
>-George.
>
>"Luke Balding" <lb******@nackware.com> wrote in message
>news:07****************************@phx.gbl...
>> 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
>>
>>
>
>
>.
>

.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.