This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Winsock in eVB


Winsock in eVB

Postby dogpoop » Feb 1, 2002 @ 10:25pm

I'm porting a winsock application in VB6 to eVB. However, I'm having a serious problem with winsock in eVB. I get no errors or anything-it seems to be working correctly, but it does not. I will explain:

In normal VB6, I send a login command to a server and it responds with 10 bytes of data. In the dataarrival event, it says bytestotal is 10, and len(strData) yields also 10. This works fine. The rest of the login sequence works perfectly.

In eVB, with *identical code* with the VB6 version, I send the login command and it responds just like vb6. Bytestotal is 10, but len(strData) is 4! Some -of the packet is missing! My login sequence will not complete. I cannot figure out how to make this work. I have tried everything I can think of and I am going insane. Can anyone help?

I tried that c++ dll winsock wrapper called cesockets or whatever, and with similar results as normal eVB. It returns 10 bytestotal but len(strData) returns 5. What the heck is going on?

It's imperative that I get this working. I don't have access to the server source so I cannot modify this. I will reiterate: the code in eVB and VB6 is now identical. It works in VB6 and not eVB. C++ DLL doesnt work either so please no "vb sucks" flames.

Has anyone experienced similar problems? Workarounds? or I would like even any sort of info on the eVB winsock control, or links to other c++ wrappers. I really need to get this to work and I can't see a solution.

Can you help me?

Thanks,
Dogpoop on a soda can.
dogpoop
pm Member
 
Posts: 17
Joined: Feb 1, 2002 @ 10:17pm


Postby Dan East » Feb 1, 2002 @ 10:34pm

VB isn't my thing at all (never touch the stuff), but UNICODE may be an issue. The eVB strings should be unicode, so if you are reading 10 ascii chars into a unicode string there may be problems.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


arg

Postby dogpoop » Feb 1, 2002 @ 10:35pm

Of course, minutes after I post, I find out the reason. For those that are curious:

It is a known MS bug that the windows ce winsock control (and I think the winsock.dll also) will have problems receiving binary data. It may not receive all of it; it stops at the first ascii value of 0. This was my problem.

Even though I know what my problem is, I still need to fix it. I am wondering, is it possible to receive it as a byte array and then put it back together as a string?
dogpoop
pm Member
 
Posts: 17
Joined: Feb 1, 2002 @ 10:17pm


Winsock in eVB

Postby Pam » Feb 1, 2002 @ 10:37pm

All the easy problems have been solved.
User avatar
Pam
pm Insider
 
Posts: 449
Joined: Jan 24, 2002 @ 10:30pm
Location: Ohio


Postby Pam » Feb 1, 2002 @ 10:38pm

All the easy problems have been solved.
User avatar
Pam
pm Insider
 
Posts: 449
Joined: Jan 24, 2002 @ 10:30pm
Location: Ohio


Postby dogpoop » Feb 1, 2002 @ 11:43pm

dogpoop
pm Member
 
Posts: 17
Joined: Feb 1, 2002 @ 10:17pm


Postby RwGast » Feb 1, 2002 @ 11:50pm

http://www.angelfire.com/ego/esoteric if you like to play quake3 keep your eye on this site
User avatar
RwGast
pm Member
 
Posts: 1123
Joined: Jun 28, 2001 @ 7:36pm
Location: California, USA


Postby dogpoop » Feb 2, 2002 @ 12:09am

dogpoop
pm Member
 
Posts: 17
Joined: Feb 1, 2002 @ 10:17pm


Postby Dan East » Feb 2, 2002 @ 12:09am

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby dogpoop » Feb 2, 2002 @ 12:23am

dogpoop
pm Member
 
Posts: 17
Joined: Feb 1, 2002 @ 10:17pm


Postby Dan East » Feb 2, 2002 @ 12:31am

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby RwGast » Feb 2, 2002 @ 1:11am

Dan that isnt the probelm ;) vb does auto formating of its strings no need for a null terminator. MS has admited there control is shit. The guy ran benchmarks and it took 512ms to send his data using the vb control his C dll took 2ms or something. The control looses data sending and reciving its full of alot of bugs :(. I would recommend this person write his own winsock functions in C using winsock.h or get the dll file i mentioned at www.devbuzz.com, if you search that site for winsock youll find the article im reffering too it is very intresting.
http://www.angelfire.com/ego/esoteric if you like to play quake3 keep your eye on this site
User avatar
RwGast
pm Member
 
Posts: 1123
Joined: Jun 28, 2001 @ 7:36pm
Location: California, USA


Postby Guest » Feb 2, 2002 @ 6:32am

yep rwgast, I did read the article and got the cesockets.dll from it. I need to receive in binary mode though as it is still plagued by the "binary bug". AFAICT (as far as I can tell) it only sends strings. I tried to do what Dan said by splitting it into a byte array but I was getting errors and so I gave up for the evening :) I will have a fresh look at it tomorrow but things don't look to good :( You would think MS would have caught these completely obvious bugs before they released it. Anyone know when the next eVB (or winsock control) is coming out? ;)

BTW thanks for all your help and insight guys...I am confident I can do this eventually, Im just not sure how.
Guest
 


Postby RwGast » Feb 2, 2002 @ 8:30am

You would think wouldnt you. I was pretty disapointed with vb's winsock support you try using strait winsock api in vb yet?
http://www.angelfire.com/ego/esoteric if you like to play quake3 keep your eye on this site
User avatar
RwGast
pm Member
 
Posts: 1123
Joined: Jun 28, 2001 @ 7:36pm
Location: California, USA


Postby dogpoop » Feb 2, 2002 @ 7:30pm

dogpoop
pm Member
 
Posts: 17
Joined: Feb 1, 2002 @ 10:17pm


Next

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron