Re: Winsock problem, probably a sign of the upcomming end of the world!!
Zip up your small project, (from a separate folder) as a new project.
Include all the forms, modules, and files needed. Then, someone else can download it AND RUN IT to test it for you (as we can see what the code does BEFORE running it)
1 Attachment(s)
Re: Winsock problem, probably a sign of the upcomming end of the world!!
Ok... So what we have here, is the VB6 project (no exe...), in it, we have the code, both for the mswinsock, and the CSocketPlus, so you could run the original code, then simple comment the first 3 lines that initialize the socket object, un comment the few lines that initialize the CSocketPlus object, and see the difference... you will be able to see that normaly, with the mswinsock, the client connects, the application loads a new socket onto the stack, and accepts the connection of that user to the new socket created.... As with CSocketPlus, what happens is the connection occors, but in the proccess of creating the new socket for the user to connect to, something crashes... he doesn't like the way I wrote the code, but there is nothing wrong with it, and I have tried different ways of writing it, but with no possitive outcome.
A few pointers:
1 - My client is made in flash. if you have flash installed on your comp, you can simply open the Fla, and test run to astablish the connection. If not, you can simply throw the swf file into your IE, and it will work just the same.
2 - notice that this is a lean version of the chat, both server and client, since I didn't want to bother you with all the rest of the code, like arrays that keep information about who talks to who and so forth. If you want to see the chat in real life action, let me know, I will create account for you on the site it is published in, and give you instruction about how to get to the chat, since the site is an Italian community site.
3 - I know there was something more I wanted to add, but I simply can't remember what that was right now, if I will rememeber, I will add it later on...
Thanks guys.
Yuval Lahav.
Re: Winsock problem, probably a sign of the upcomming end of the world!!
Quote:
Originally Posted by yuvallahav
Well, I did try it, and some other titbits of stuff I found on other pages, but non seem to work... it would seem that my bug is different, since they talk about a problem on windows server 2000, and we use 2003, it talks about UDP protocol, where I use TCP... it talks about an error not being catched by your normal socket error handler, where mine do, but then crashes the whole project...
Today I will try the socket WizBang linked to, and see if I can detect any difference.
Thanks!
i guess the error can happen also happen in TCP, when the client suddenly closes (by accident which is usual in chat apps) the socket while the server is sending an information. anyway, i've created some SMTP/FTP client apps on our Win2003 server two years ago, they were running 24/7 since then and none of them reported such error.
we have different applications however the socket component that we used are the same. if you don't mind, try posting code snippets here - dataarrival, close, et al (and even your error handling routine).
Re: Winsock problem, probably a sign of the upcomming end of the world!!
so you posted it already :D, i'll look into it also when time permits :wave:
Re: Winsock problem, probably a sign of the upcomming end of the world!!
there are 3 things i noticed in the code, but still (:D) i'm not sure if the error can be resolved by these..
1.) there is no trimming of the winsock control array, the array index may grow until there is no much resources to allocate in the server.
2.) there is no error handling on the dataArrival (GetData method) and even in SendData method. client may disconnect anytime in chat application so this may cause error.
3.) a message may arrive in chunks (two or more dataArrival event) especially for large message and/or slow networks/computers. you may wrap the message in a stucture (ie, header-body-footer) to parse it properly.