Created
December 4, 2022 00:35
-
-
Save peevees/1ad7b3a61086d501a60fdefddb8e9d62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On the server (laptop): | |
``` | |
> $Listener = [System.Net.Sockets.TcpListener]52134; | |
> $Listener.Start(); | |
> while($true) | |
> { | |
> $client = $Listener.AcceptTcpClient(); | |
> Write-Host("Connected at " + $(Get-Date)); | |
> $client.Close(); | |
> } | |
``` | |
On the client (another pc on the same network): | |
``` | |
> $hostIp = "<machine network ip>" | |
> $port="52134" | |
> (new-object Net.Sockets.TcpClient).Connect($hostIp, $port) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment