Python Forum
Multiple network socket servers?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple network socket servers?
#1
Hi there.

Sockets confuse me, even with a fairly simple set of handshakes I get fuddled!

I have a number of unix servers, just as an exercise I want to send a small packet of data randomly around the network. Each machine will run a socket server and has a BlinkStick attached to give the user some feedback.

So with the socket code running on all machines I need the following:

Machine 1 randomly chooses an ip address xxx,xxx,xxx,45
Machine 1 sends "Hello"
Machine 45 replies "Im here"
Machine 1 sends "DATA PACKET".
Machine 45 replies "Got it"

Machine 45 then repeats the process. (obviously with error and condition trapping)

Where I'm getting confused is: Socket server code can handle all of the above, except sending the Hello and the PACKET. So I'm handling all the conditional code in the Sock Server??

I don't have any sample code at the moment, I want to get the process sorted in my head before I start writing something completely wrong!

Any ideas welcome. Are there any socket wrappers that might make this easier?
Latency is not an issue as there will be lots of 'sleeps' so the user can see what's going on.

Many, many thanks.
Reply
#2
In short, a server is a program which is listening to a port. It can take some actions once a connection is established. For example, sending back an answer or connecting to another listener. Whatever is necessary. So it can behave as a server and a client. A proxy server is such a program.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how to split socket data onto multiple clients for separate processing ConcealedFox70 0 1,939 Jan-11-2022, 08:26 PM
Last Post: ConcealedFox70
  [Socket] Can a server be accessible from devices not in the same network? SheeppOSU 2 2,965 Jun-18-2020, 01:29 PM
Last Post: DeaD_EyE
  Server and Network (socket) [WinError 10053] Timxxx 1 4,586 Aug-23-2019, 10:03 AM
Last Post: iMuny
  Server and Network (socket) [WinError 10053] SheeppOSU 2 22,313 Apr-13-2019, 09:23 PM
Last Post: SheeppOSU
  Socket won't receive data suddenly with multiple clients SquareRoot 0 2,788 Sep-06-2017, 09:09 PM
Last Post: SquareRoot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020