TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
Go Back  Xtreme Visual Basic Talk > > > TCP/IP Client/Server communications problem


Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2010, 02:50 PM
elemein elemein is offline
Newcomer
 
Join Date: Oct 2010
Posts: 14
Default TCP/IP Client/Server communications problem


Edit by Moderator: Re: [VB6 and API] - learning mutliplayer games
Hi, I'm a lil new here :/ But I tried doing this: http://vb.microbolt.com/Tutorials/TC...5/Default.aspx

With my friend, and followed the instructions perfectly, except I changed the remotehost to my IP since it was going to be over the internet. The ports matched and everyhting. But when he tried to send, he got a runtime error or a protocol error, when I was fine on the server side (but I wasnt getting any messages from him)

We could not send messages back and forth, I was displaying the data (that I wasnt getting) in the caption of a label, can someone help me?
Edit by Moderator: Please start a new thread to ask your own questions. I've created a link to the original thread for you. Thanks, and welcome to the forum.

Last edited by Cerian Knight; 10-31-2010 at 04:52 PM.
Reply With Quote
  #2  
Old 11-07-2010, 11:20 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

it won't work, it doesn't work, it never worked.
...everyone knows it doesn't work.

the only people who post solutions are the ones who never used it.

i'm working on getting a solution, if i do i'll let you know
__________________
The Pho·net·ic Programmer
Reply With Quote
  #3  
Old 11-08-2010, 01:48 AM
ZaCkOX's Avatar
ZaCkOX ZaCkOX is offline
Contributor
 
Join Date: May 2006
Location: CA
Posts: 645
Default ?

Solution already posted at: [VB6 and API] - learning mutliplayer games

and the link is posted by an moderator right above your reply... are you ok Wolf?

__________________
ZaCkO ... Who is your attitude?
Reply With Quote
  #4  
Old 11-08-2010, 09:54 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

that post doesn't show the solution, which will most likely be solved by the Package and Deployment Wizard.
(yes. this is the first time i've heard of it. remember,many of us are self taught)


Add ins/ Add in manager/ Package and Deployment Wizard/ loaded-unloaded.

then follow steps which i haven't done yet
__________________
The Pho·net·ic Programmer
Reply With Quote
  #5  
Old 11-09-2010, 12:03 AM
ZaCkOX's Avatar
ZaCkOX ZaCkOX is offline
Contributor
 
Join Date: May 2006
Location: CA
Posts: 645
Default Still don't understand you?

Well I'm self taught too. I followed a lot of different tutorials for winsock tcp/ip and there was definitely bumps in the road. But the sample doesn't have the bumps I found. However it is a sample, not a complete tutorial. A step by step tutorial takes a lot of time to develop. And when I think about doing a tutorial, it really isn't worth it if people aren't studying how it works in the first place. More likely people are just copying and pasting. And not even taking the time to still study how to solve their own problems (Ultimately I just didn't have the time. I was planning to make a tutorial.)

At least there is a sample. Think positive, and it works. Plus I commented on the problems posted in the thread. So I don't understand where you are going.

Can you directly say what the problem is and what you need solved?
__________________
ZaCkO ... Who is your attitude?
Reply With Quote
  #6  
Old 11-09-2010, 02:01 AM
Flyguy's Avatar
FlyguyTCP/IP Client/Server communications problem Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,162
Default

Quote:
Add ins/ Add in manager/ Package and Deployment Wizard/ loaded-unloaded.
What has the Package and Deployment Wizard to do with Winsock programming?
Maybe you mean the sample do work, but if you want to distribute your application you have to create a setup package. This is always the case and not related specifically to Winsock control.
Reply With Quote
  #7  
Old 11-09-2010, 08:38 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

Quote:
Can you directly say what the problem is and what you need solved?
right now, none ,thank you.
i've tried the Package and Deployment Wizard and my server/client works on my other computer connected to my modem.
i haven't tested on another computer over the net yet.

Quote:
What has the Package and Deployment Wizard to do with Winsock programming?
Maybe you mean the sample do work, but if you want to distribute your application you have to create a setup package. This is always the case and not related specifically to Winsock control.

i found out how to use Winsock a couple of years ago, it tests fine on my
own computer.
it wasn't until i tried to test my first client/server that i found out something was wrong.

you can find countless questions on the net about why we get error "mswinsck.ocx not loaded" , error "40006" and error "40020" and everyone only leaves a different piece of the puzzle.

i've read every response thread i could find, nothing talks about setting up the program or using the Package and Deployment Wizard.

people like me have been saving our projects as an EXE unknowing the msWinsck.ocx comes with the set-up bundle.

to a self-taught programmer it's hard to find information you don't know you should be looking for.
__________________
The Pho·net·ic Programmer

Last edited by wolfstrike; 11-10-2010 at 12:50 AM.
Reply With Quote
  #8  
Old 11-09-2010, 10:12 PM
ZaCkOX's Avatar
ZaCkOX ZaCkOX is offline
Contributor
 
Join Date: May 2006
Location: CA
Posts: 645
Default Wow

I'm totally shocked because this wasn't hard for me. Somewhere on my hard drive I have documentation on how to add code to the Package and Deployment Wizard. You should know you'll need the mswinsock.ocx in the directory of the program you create by debugging. I found with Windows 7 it will work if the program is ran as Windows XP. But I run these tests at home and on friends' computers and it worked with very few problems. Maybe you just had bad luck looking.

I was searching for directx tutorials for a week before I found it here. Tried different search engines and I kept finding links for vb.net. Finally I just thought I would look here and the link wasn't working. So I thought I keep trying and guess what the link worked when I checked back.
__________________
ZaCkO ... Who is your attitude?
Reply With Quote
  #9  
Old 11-15-2010, 12:15 AM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

i tried it again.

i sent the whole package to the other compter, i got error "40006" again.

it works only with a computer connected to my modem
__________________
The Pho·net·ic Programmer
Reply With Quote
  #10  
Old 11-15-2010, 12:58 AM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

http://img191.imageshack.us/img191/6302/porttb.jpg

heres a picture of my new port setting
__________________
The Pho·net·ic Programmer
Reply With Quote
  #11  
Old 11-15-2010, 01:39 AM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

so....

i think i might have to set up a static IP and choose a port over 20,000

...?
__________________
The Pho·net·ic Programmer
Reply With Quote
  #12  
Old 11-15-2010, 02:54 AM
Banjo's Avatar
BanjoTCP/IP Client/Server communications problem Banjo is offline
Hell's Angel

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Yorkshire, UK
Posts: 10,394
Default

When you say "sent the whole package to the other computer", what exactly does that mean?

For sending a program out to end users, I would agree, an installer is a very good idea. However, for development testing it is overkill and you're better off understanding the requirements anyway.

Assuming that other computer doesn't have VB6 installed then you need to make sure that it has two things for a really basic winsock program:

1) msvbvm60.dll
2) mswinsck.ocx

Both should be in the %systemroot%\system32 folder. If VB is installed then they should both already be present. If they're not then you need to copy them from your working system.

msvbvm60 is a normal static linked dll and just needs to be dropped in place.
mswinsck.ocx is a COM library and needs to be registered with windows using:

regsvr32 %systemroot%\system32\mswinsck.ocx

in the run box or at a command prompt.

If you have any dlls or ocxs referenced to the project then you'll need to ensure that these are present and registered too.
__________________
A wise one man once said "what you talking about dog breath"
Reply With Quote
  #13  
Old 11-15-2010, 01:34 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

once i started using the Package and Deployment Wizard , on the suggestion of a programmer who says Winsock always needs this, i stopped having the problem of "msWinsck.ocx not found"

i am no longer getting an error saying 'missing files'

i looked and the set-up also provides "msvbvm60.dll"


currently i'm getting "40006"
i'm going to try making a static IP and adjusting port settings, but it takes me about 2 weeks to get to another computer to test
__________________
The Pho·net·ic Programmer
Reply With Quote
  #14  
Old 11-15-2010, 03:34 PM
ZaCkOX's Avatar
ZaCkOX ZaCkOX is offline
Contributor
 
Join Date: May 2006
Location: CA
Posts: 645
Default Router?

What router do you have? And model.... The reason I ask is even if you set port forward the program still might not work. I had some old linksys routers and their port forward did not work even though they had port forwarding enabled.

Firmwire is a big deal nowadays. And in some cases people are just hacking thier's. I can't blame them, I paid for port forwarding, give me port forwarding.

I'm still finding problems with the newer routers. But thankfully we are moving forward.

Error code: "40006" Wrong Protocol?

Hmm... do you have multiple network connections? Might need to do a winsock.bind.
__________________
ZaCkO ... Who is your attitude?
Reply With Quote
  #15  
Old 11-15-2010, 04:35 PM
Banjo's Avatar
BanjoTCP/IP Client/Server communications problem Banjo is offline
Hell's Angel

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Yorkshire, UK
Posts: 10,394
Default

Quote:
Originally Posted by wolfstrike View Post
once i started using the Package and Deployment Wizard , on the suggestion of a programmer who says Winsock always needs this, i stopped having the problem of "msWinsck.ocx not found"
i am no longer getting an error saying 'missing files'
i looked and the set-up also provides "msvbvm60.dll"
What I was explaining to you is that "a programmer's" advice that winsock requires the Package and Deployment wizard is complete crap. You need to deploy the project's referenced libraries. This can be done manually or it can be done with an installation package. The package and deployment wizard is just one such installer. There are many others.

Quote:
Originally Posted by wolfstrike View Post
currently i'm getting "40006"
i'm going to try making a static IP and adjusting port settings, but it takes me about 2 weeks to get to another computer to test
1) Which line of code gives that error?
2) What is the winsock control's State property when the error occurs?
3) Has the Connect event fired by this point?
4) What is the Protocol property set to?
__________________
A wise one man once said "what you talking about dog breath"
Reply With Quote
  #16  
Old 11-15-2010, 06:25 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

Quote:
What router do you have? And model
verizon westell a90-750015-07


Quote:
do you have multiple network connections?
there is 3 computers showing on my network, i just created a static ip, but i haven't had a chance to test

Quote:
I paid for port forwarding, give me port forwarding.
do i have to buy this just to have a successful test?
i've already changed forwarding on my router


Quote:
1) Which line of code gives that error?
i press "connect" then when i send messege i get "40006", because it never connected


Quote:
2) What is the winsock control's State property when the error occurs?
not sure, it's not connected


Quote:
3) Has the Connect event fired by this point?
no


Quote:
4) What is the Protocol property set to?
0-sckTCPprotocall



the programs work fine on my computer, and on my remote computer.
it doesn't work over the internet to an unrelated computer
__________________
The Pho·net·ic Programmer
Reply With Quote
  #17  
Old 11-15-2010, 06:46 PM
Banjo's Avatar
BanjoTCP/IP Client/Server communications problem Banjo is offline
Hell's Angel

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Yorkshire, UK
Posts: 10,394
Default

So you're doing this:
Code:
winsock1.Connect winsock1.SendData sMsg

If so then this will never work. The winsock control is asynchronous. When you call the Connect method, it will return control to your program immediately. At some indeterminate time in the future, the connect event will fire and at this point the control's State property will change from unconnected to connected (or possibly connecterror).

The SendData method is the same. You call it and then some time in the future you'll receive a DataArrival event. Note that the return message may not appear in a single event. You may have to concatenate messages across multiple calls to the DataArrival event.

If you already know this then you have a network problem. In which case, have you tried using telnet to send messages to your listening app? If that won't work then nothing will.

As Zack said, make sure your router is patched and configured correctly.
__________________
A wise one man once said "what you talking about dog breath"
Reply With Quote
  #18  
Old 12-04-2010, 11:37 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

nothing works


when i started using the Package and Deployment wizard i thought it would solve the problem.

it got rid of my DLL errors, but now i'm back to error code "40006".
"wrong connection state" (after trying to send a messege)

it doesn't seem to me the program is even attempting to connect to anything.
maybe i'm missing something baisc.

i went into the remote computer and opened up a port on the firewall, and allowed the program on the firewall, still nothing.
...even if i shut off the firewall

these programs connect and work on my other computer on my same modem, but won't work over the internet.


i used a program that says it used Telnet, and i was able to send messeges to my server


i'm posting my server, client, and Telnet program
Attached Files
File Type: zip ServerF.zip (2.9 KB, 16 views)
File Type: zip ClientF.zip (3.5 KB, 14 views)
File Type: zip TelnetTTY.zip (15.8 KB, 12 views)
__________________
The Pho·net·ic Programmer
Reply With Quote
  #19  
Old 12-05-2010, 12:10 AM
ZaCkOX's Avatar
ZaCkOX ZaCkOX is offline
Contributor
 
Join Date: May 2006
Location: CA
Posts: 645
Default So?

So these projects in progress? I was examining the code and there's a lot of open spots. Declaring a static variable, but don't even use it?

Another thought, have you cleaned your winsock? Once you install all these firewalls, and run through the internet, sometimes the winsock can get corrupted and doesn't work properly. I've even seen where removing and installing the network over doesn't help at all and had to resort to erasing the hard drive and reinstalling the os. Of course in the end that works.

You can look into some programs to default the registry. I can't remember what they are called. But again this only worked if it wasn't worst case scenario.

Also before I forget, wrong connection state... that might mean the protocol is not rdy to connect. You should find the state it is when you get the error. Again I would go with my suggestion above if my sample tcp/ip doesn't work for you.
__________________
ZaCkO ... Who is your attitude?
Reply With Quote
  #20  
Old 12-05-2010, 12:29 AM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

i had a system where i could cycle through different IP numbers, thats what the variable was for.
i recently made a static IP address, and it tested fine with the computer connected to the same modem.


someone said if it shows a Ÿ character in the DOS window then that means it's corrupted.
i didn't have that, but that character does show up when i use Telnet.

i tried to uncorrupt Winsock by typing a command into the Run window
__________________
The Pho·net·ic Programmer
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
 
TCP/IP Client/Server communications problem
TCP/IP Client/Server communications problem
 
-->