# PetscViewerSocketSetConnection
Sets the machine and port that a PETSc socket viewer is to use 
## Synopsis
```
PetscErrorCode PetscViewerSocketSetConnection(PetscViewer v, const char machine[], int port)
```
Logically Collective on v


## Input Parameters

- ***v -*** viewer to connect
- ***machine -*** host to connect to, use NULL for the local machine,use "server" to passively wait for
a connection from elsewhere
- ***port -*** the port on the machine one is connecting to, use `PETSC_DEFAULT` for default





## See Also
 `PETSCVIEWERMATLAB`, `PETSCVIEWERSOCKET`, `PetscViewerSocketOpen()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/socket/send.c.html#PetscViewerSocketSetConnection">src/sys/classes/viewer/impls/socket/send.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/socket/send.c)


[Index of all Viewer routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
