|
-
Aug 19th, 2009, 12:46 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Braodcasting message over Lan usng winsock (vb6)
Good day guys,
am trying to broadcast message too server from client using port rang technique on lan
the server receives one client and connect them. but when another tries to connect, it says address in use.
thanks.
-
Aug 26th, 2009, 06:14 AM
#2
Member
Re: Braodcasting message over Lan usng winsock (vb6)
If you are using TCP and not using an control array then you can only have one connection at a time. Now if you UDP, I'm not to sure.
Please try to provide some more info. Ports numbers, Protocol?
-
Aug 26th, 2009, 08:30 AM
#3
Thread Starter
Fanatic Member
Re: Braodcasting message over Lan usng winsock (vb6)
am using winsock tcp but using udp to do the broadcast. i used cvmicheal work but its only one pc to i server.
i tried using multiple connection with no success
-
Aug 26th, 2009, 10:30 PM
#4
Member
Re: Braodcasting message over Lan usng winsock (vb6)
So after finding the example you used, here is your problem...
The example was written to accept one connection at a time using TCP. So, using that only two people can chat at a time. What you need to do to accept more connections is use a control array. It is a little more work but you can do it.
-
Aug 27th, 2009, 07:46 AM
#5
Thread Starter
Fanatic Member
Re: Braodcasting message over Lan usng winsock (vb6)
if it is accepting multiple connections, i can do that but its Braodcasting message over Lan usng winsock. The server dosent know the client ip, so is the client .
the client should broadcast their ip and the server finds them and send them his own ip
-
Aug 27th, 2009, 04:00 PM
#6
Member
Re: Braodcasting message over Lan usng winsock (vb6)
How many people to you intend to use this program.
Here is a problem with your current setup.
Only two people can really talk to each other. If you could get more connections, that means that one person will be connected to two people
i.e.
Bob is talking to Alice. Bill connects to Bob's "server".
So now anything that bob says both Alice and Bill will see what Bob wrote.
However Alice can't talk with Bill, and Bill can't talk with Alice.
If you plan or need to have more than two people you're going to have to make a real message server. Where when one person sends a message, the server receives the message and then sends it to everyone connected to the server.
-
Sep 3rd, 2009, 05:27 AM
#7
Thread Starter
Fanatic Member
Re: Braodcasting message over Lan usng winsock (vb6)
finally i got it to work!!
i placed three winsock controls on the server, 1 for TCP which is a socket array and two other udp . 1 to listen (udplisten), and the other to reply (udpreply).
The one that listens just listens for client ip request. as i said before. the client should find the server not the server finding the clients. this will reduce server workload.
the client scan port range of which the server must listen on, that is the udplisten socket
the client constantly send message to all the ports within fraction of a second until it gets a reply from the server.
if they get disconnected, they do the same thing again
if you need my code sample, please say so!!
thanks for all who contributed.
Last edited by coolcurrent4u; Sep 4th, 2009 at 05:58 AM.
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
|