Can p4api.net connect to a (local) p4 personal server?

499 Views Asked by At

Can p4api.net connect to a (local) p4 personal server?

I started a personal server with

p4 -u itsame -d c:\perforce\local -c itsameClient clone -m 1 -v -p p4server:somePort -f //repo/path/...

It works - it can use it in p4v or from the command like - there's even the .p4root in c:\perforce\local.

However, from the latest p4api.net, it just keeps trying to use TCP to connect. Is there no way to say this is to the file system - or perhaps does the personal server expose itself to localhost:port somehow?

1

There are 1 best solutions below

0
On BEST ANSWER

The client application's P4PORT needs to be set correctly in order to connect to a server. For a remote server you simply specify the hostname:port. For a personal server, there's a special P4PORT syntax that specifies how the local server executable is to be invoked to service client requests. You can see it by running p4 set P4PORT within your personal server directory:

C:\Perforce\test>p4 set P4PORT
P4PORT=rsh:p4d.exe -i -r "c:\Perforce\test\.p4root" (config 'c:\Perforce\test\p4config.txt')

Note that when you initialize a personal server, it automatically sets up P4CONFIG in that directory, which is why that P4PORT is automagically set for you already. Your P4API.NET application should be able to use that same config (removing the need to manually copy over the P4PORT string) as long as:

  • it has the correct cwd set (i.e. the directory the personal server lives in)
  • the P4PORT is not overridden with an incorrect value