Skip to content

Commit

Permalink
Add -fsys.addr flag for Windows
Browse files Browse the repository at this point in the history
This allows user to listen to a specified port instead of a random one.
  • Loading branch information
fhs authored and rjkroege committed Sep 26, 2019
1 parent 4035864 commit 0e73df1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fsys_windows.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
package main

import (
"flag"
"fmt"
"net"

"9fans.net/go/plan9/client"
"github.com/fhs/mux9p"
)

var fsysAddr net.Addr
var (
fsysAddrFlag = flag.String("fsys.addr", "localhost:0", "9P file system listen address")
fsysAddr net.Addr
)

func newPipe() (net.Conn, net.Conn, error) {
c1, c2 := net.Pipe()
return c1, c2, nil
}

func post9pservice(conn net.Conn, name string, mtpt string) error {
l, err := net.Listen("tcp", "localhost:0")
l, err := net.Listen("tcp", *fsysAddrFlag)
if err != nil {
return fmt.Errorf("listen failed: %v", err)
}
Expand Down

0 comments on commit 0e73df1

Please sign in to comment.