|
-
Feb 26th, 2006, 12:36 PM
#1
Thread Starter
Fanatic Member
[Solved with a happy ending] Winsock error
I've got chat program and wanted to add file sharing across it. The thing is that i keep getting this winsock error:
(40006) Wrong protocol or connection state for the requested transaction or request.
I don't know what to do with it. I've tried everything I can . I don't know why it's happening! I've now tried adding msgbox to see what the status of the two winsocks that i have got for filesharing. Came up with both 7. I take it something went wrong with it.
I have 2 forms, 3 winsocks (just to keep the connecting and the listening winsocks seperate for this). The ones with tcp are the filesharing winsocks. the wsChat winsock is for chatting (duh!).
Can anyone help? The source is attached since I can't actually paste it onto here.
Last edited by kregg; Mar 14th, 2006 at 06:39 AM.
-
Feb 26th, 2006, 05:53 PM
#2
Re: Winsock error
there error means when your program tried to send some data, the sockets state is not connected.
I've now tried adding msgbox to see what the status of the two winsocks that i have got for filesharing. Came up with both 7
VB Code:
MsgBox frmMain.tcpClient.State
MsgBox frmMain.tcpClient.State
The above code is in your project, take a look at it.....its only checking the state of tcpClient. In your project the socket for sending files is tcpServer. When you try to send data it fires the error because tcpServer is not connected
-
Feb 26th, 2006, 06:10 PM
#3
Thread Starter
Fanatic Member
Re: Winsock error
Thanks for pointing that out. I've been working on this for 2 days now so I think I've lost some brain cells if not any at all in the process. I'll get working on the tcpServer tommorow to see if I can get it to connect. Thanks for pointing out the tcpServer aswell the182guy.
-
Mar 3rd, 2006, 06:59 AM
#4
Thread Starter
Fanatic Member
Re: Winsock error
This may sound like a stupid question, but how can I make the tcpServer connect properly? Doesn't seem to like working properly
-
Mar 3rd, 2006, 07:57 AM
#5
Re: Winsock error
tcpServer should be the one that accepts the connection, what do you mean by doesnt seem to be working, does it error?
-
Mar 3rd, 2006, 09:56 AM
#6
Thread Starter
Fanatic Member
Re: Winsock error
yeah i think so...
let me try giving the code a go once more and i'll let you know how it goes.
-
Mar 4th, 2006, 06:26 AM
#7
Thread Starter
Fanatic Member
Re: Winsock error
I now found out the tcpClient has errors as before. I think I didn't do anything since I was completely clueless on how to solve it. You said before it's because it's tcpServer not connecting right. Would it help if I made the tcpConnect on a seperate button so I can connect it seperately and see the difference?
-
Mar 4th, 2006, 06:38 AM
#8
Re: Winsock error
is the code in post#1 the latest version?
-
Mar 6th, 2006, 09:09 AM
#9
Thread Starter
Fanatic Member
Re: Winsock error
No, not yet. I'll get it uploaded.
Come to think of it, I don't think i've modified anything with my version. I don't know because this is a public pc (basically away from my pc), but i'm sure i haven't done much to it, so you can scrutinize it as much as you like
-
Mar 9th, 2006, 05:29 AM
#10
Re: Winsock error
Are you still having problems or is this solved?
-
Mar 9th, 2006, 06:07 AM
#11
Thread Starter
Fanatic Member
Re: Winsock error
I'm still having problems.
The problem is I don't know where to start to solve the problem
-
Mar 10th, 2006, 12:59 PM
#12
Re: Winsock error
i've tested it, chat works, i sent a file, works, i chatted more, works.....no errors??
-
Mar 13th, 2006, 04:57 AM
#13
Thread Starter
Fanatic Member
Re: Winsock error
It actually worked??? My god that's something!!! I'll retest it again at home.
Did you test it over two PCs? Because I tested it over one PC using the 127.0.0.1 ip and that kinda sucked.
-
Mar 13th, 2006, 01:16 PM
#14
Thread Starter
Fanatic Member
Re: Winsock error
Thanks dude it actually works !
I wanted to rate your post, but it says i'll need to rate someone else before I can do you again, so I think I must've rated you before.
Cheers for the help!
-
Mar 13th, 2006, 01:54 PM
#15
Re: Winsock error
lol okay!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|