Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello everybody. i want to create an application where a server will be able to send messages to client using Winsock. The clients can only receive the message and not be able to respond. I have made something but the program is using the same number for local and remort port. I can get a msg from the other computer but I can't send one. It really drives me craaaazy!! Any help will be much appriciated.
the first lines of the program are:
'set winsock properties
Winsock1.Protocol = sckUDPProtocol
Winsock1.LocalPort = 2167
Winsock1.RemotePort = 2167Thank you in advance..

Well, by the looks of it you are using Visual Basic 6.0, correct me if I am wrong.
Your two lines confuse me...
"...The clients can only receive the message and not be able to respond..."
and a few lines down...
"...I can get a msg from the other computer but I can't send one...
I was under the impression that you wanted the server side to send msg to the client... Then have the client to only view the msg, but not be able to reply. Is this not the case?
Well, for starters change one of your port settings to be different than the other. Local 2167 and Remote 2168 for instance. Then under the Data Arrival event of the client, have a msgbox or whatever mechanism you want display the data that the server sent over.
Post back if you still have problems.
IR

Hello IR. Yes I do have VB6. I was trying to have the same program running as Server and as client, but apparently it doesn't work. Now I am trying to use a client and a server in two different programs. I am using different port numbers as you suggested and so far it's working. Thank you for your help. :-)

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |