OSX and G-net ?

Archives Forums/MacOS X Discussion/OSX and G-net ?

cps(Posted 2016) [#1]
Has anybody tried using G-net with Mac OSX? as I am having a few problems with it.
(I've used the port scanning utility to make sure the port used is free.)
I can create a host using Host = CreateGNetHost() then use GNetListen( host, port number) which creates a host (server) with no name appearing in the g-net lobby.
Otherwise if I use the host to create the LocalObj=CreateGNetObject:TGNetObject( host ) then attempt
GNetConnect( Host,server name, port number, timeout_ms ) even though I can retrieve the 'server name' and the 'port number' from the g-net lobby
I get a timed out connection faliure. I think the problem may be connected with the following

Using : IP$= dottedip(hostip("",0)) returns 0.0.0.0
and using : MyCpuname$=hostname(hostip("",0)) returns "" ie empty string.
PS I have been using these methods on PC's and it's working however I am a novice when it comes to Mac's.
Any pointers would be most welcome, have fun Cps


cps(Posted 2016) [#2]
For anybody stumbling as above, G-net does work with Mac OSX. The problem seems to be finding the Local IP of the IMAC. Have fun Cps


cps(Posted 2016) [#3]
A thread all to myself.. If anybody does have this problem with PC-MAC Comms, the solution seems two fold.
First switch from using server_name$ (server_name = the computer you are trying to connect to) in the line GNetConnect( Host, server_name, port number, timeout_ms )
to using Local_IP$ in place of server_name$. Secondly derive the Local_IP$ from the MAC by using the solution supplied by 'Brucey' and make make use of his Bah.Inet module.
Or the solution provided by 'Ked', LocalIP$ = DottedIP(HostIP("My_Local_Mac_Name.Local")) be sure to provide the local computer name and include the .local bit on the end of the string.
As explained above the solutions aren't mine but supplied by 'Ked' and 'Brucey' many thanks to them both. I hope this prevents anybody else running around in circles, have fun Cps


cps(Posted 2016) [#4]
Continuing the thread to myself approach here is a solution provided by simonarmstrong. (if using MaxGui)

MacName$=ComputerName$()' an undocumented function
MacUser$=UserName$()' an undocumented function

Hence
LocalMacName$=replace(ComputerName$," ","-")+".local" and
DottedIP$=DottedIP(HostIp(LocalMacName$))

Which if universal (applies to all Mac OSX) then problem solved, have fun Cps