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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird problem with Winsock...

Status
Not open for further replies.

klibby

Programmer
May 30, 2001
51
0
0
US
ok, I've worked with Winsock (6.0) a lot, made a bunch of network games and such and I have never had this problem.

I'm making a remote administration tool, using winsock. after working on a start for the server, I made a cheapo client just to test the login part of it i made so far... which looking through the code it "should" work, but it didnt.... So I made it output all info sent and received on both apps for some debuging....

Here's what I got, when the server sent something like ".auth pass" to the client... in the client it received it as "?????" and vice versa...

I dont have any encryption working on it and I am using Winsock6 on both apps....

To send data im using:
Winsock.senddata ".auth " & type


to receive:
dim incString as string
winsock.getdata incString
 
oh, btw... if this means anything, I'm using Windows XP Pro (havent really done anything with winsock since I loaded XP)
 
Thought #1:

This (WinXP) may be the first Unicode-native machine you've programmed on, am I right? Your program might be "breakin' the law" and using VB constructs that are not safe, not proper, but you get away with 'em on an ANSI/ASCII machine. It is quite possible to expect ASCII and have it sent to you as Unicode (a double-byte character set), or have failed conversions, etc.

For example, Winsock data is passed as ASCII. If you aren't careful about bringing this into a VB string (Unicode) you get a mess. This is one of the reasons for the StrConv() intrinsic.

I could be all wet here.

Thought #2:

Have you looked at TCPTap for development and debugging of TCP socket programs? This is really a cool traffic capture thingy, recording client/server interactions to a disk (text) file. Plus, the beta is free! I got it at
Saves me putting a lot of that trace code into my own VB applications, which always ends up being a debugging hassle in itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top