Example #1
0
func main() {
	//needle.InstallCtrlCPanic()
	flag.Parse()
	fmt.Fprintf(os.Stderr,
		"Starting Needle Connect, 2010 (C) Petar Maymounkov, "+
			"http://github.com/petar/GoNeedle\n")

	peer, err := needle.MakePeer(*flagLocalId, *flagBind, *flagServer)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Problem starting peer: %s\n", err)
		os.Exit(1)
	}

	fmt.Fprintf(os.Stderr, "Dialing %s, using server %s\n", *flagRemoteId, *flagServer)
	peer.Dial(*flagRemoteId)

	<-make(chan int)
}
Example #2
0
func main() {
	//needle.InstallCtrlCPanic()
	flag.Parse()
	fmt.Fprintf(os.Stderr,
		"Starting Needle Listen, 2010 (C) Petar Maymounkov, "+
			"http://github.com/petar/GoNeedle\n")

	_, err := needle.MakePeer(*flagLocalId, *flagBind, *flagServer)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Problem starting peer: %s\n", err)
		os.Exit(1)
	}

	fmt.Fprintf(os.Stderr, "Listening for connections on %s, using server %s\n",
		*flagBind, *flagServer)

	<-make(chan int)
}