Hello,
While reading the Dictionary it often refers to "connection names" that are associated with a socket - assigned by the accept connection or open socket command.
One can append these connection names to a socketID (ipaddress:port) with a vertical bar "|".
Yet I don't see how to get or set such.
What I do see is that when connecting to a port on a socket server (opened via accept connection) is that the "open socket call returns a different port number than the one sent out with the open socket call.
Using that port number does connect to the socket server - specifically to the port referenced in the open socket call.
I know it does connect to that specific port because my socket server handles multiple ports with different functionality for each port.
But there is no opportunity to further identify the connection with a name that I have found.
So how?
Thanks,
Andrew
How set socket connection Name
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 118
- Joined: Thu Sep 20, 2012 5:11 pm
Re: How set socket connection Name
Two different scenarios here:
When you're opening a remote socket you can assign a name at that time:
The dictionary example is
When you're receiving an open socket request via an accept connections request you can't do this.
What you can do is use the remote port address you get from the client when you act on that socket
But you have to manage the names yourself
When you're opening a remote socket you can assign a name at that time:
The dictionary example is
Code: Select all
open socket to "ftp.example.org:21|sendFiles"
What you can do is use the remote port address you get from the client when you act on that socket
Code: Select all
write "xyzzy" to socket pRemoteSocket&"|client42"
read from socket "127.0.0.0:20|foo" until linefeed
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev