Perforce uses a client/server architecture. Files are created and edited by users on their own client hosts; these files are transferred to and from a shared file repository located on a Perforce server. Every running Perforce system uses a single server and can have many clients.
p4d
program is run on the Perforce server. It manages the shared file repository, and keeps track of users, clients, protections, and other Perforce metadata.
p4
program is run on each Perforce client. It sends the users's requests to the p4d
server program for processing, and communicates with p4d
via TCP/IP.
p4
program needs to know the address and port of the p4d
server that it communicates with. This address is stored in the P4PORT
environment variable.
p4
client needs to know two things in order to talk to the p4d
server:
p4d
is running on
p4d
is listening on.
P4PORT
. It is possible that your system administrator has already set P4PORT
; if not, you'll need to set it yourself.To verify the connection, type
p4 info
at the command line. If the P4PORT
environment variable is correctly set, you'll see something like this:
The
server address:
field shows which p4d
server has been connected to; it displays the host and port number that p4d
is listening on.
Error: Connect to server failed; check P4PORT. TCP connect to perforce:1666 failed. Perforce: host unknown. |
then
P4PORT
has not been correctly set. If the value you see in the third line of the error message is Perforce:1666
(as above), then P4PORT
has not been set at all; if the value are anything else, P4PORT
has been incorrectly set. In either case, you'll need to set the value of P4PORT
. Telling p4 Where p4d is
Before continuing, you'll need to ask your system administrator the name of the host that p4d
is located on, and the number of the TCP/IP port it's listening on. Once you've obtained this information, set your P4PORT
environment variable to host:port#, where host is the name of the host that p4d
is running on, and port# is the port that p4d
is listening on.
If the p4d host is named... |
and the p4d port is named... |
set P4PORT to: |
---|---|---|
dogs
|
3435
|
dogs:3435
|
x.com
|
1818
|
x.com:1818
|
If the p4d host is named... |
and the p4d port is... |
set P4PORT to... |
---|---|---|
<same host as the p4 client>
|
9783
|
9783
|
perforce
|
1666
|
<no value needed>
|