This file contains hidden or 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
// Add multicast support to UDPConn | |
package net | |
import ( | |
"os" | |
"syscall" | |
"fmt" | |
) | |
// Join a multicast group. Only IPv4 addresses are supported |
This file contains hidden or 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
package main | |
import ( | |
"net" | |
"crypto/tls" | |
"os" | |
"io/ioutil" | |
"time" | |
) |
This file contains hidden or 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
# A sample top level Makefile for multi package Go projects. | |
include $(GOROOT)/src/Make.inc | |
CMDS=\ | |
command-1\ | |
command-2\ | |
command-3 | |
PKGS=\ |
This file contains hidden or 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
c: <?xml version='1.0' ?><stream:stream to='cheney.net' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'> | |
s: <stream:stream from="cheney.net" id="C9F7A89AC4194FBC" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client.><stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required/></starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-GOOGLE-TOKEN</mechanism></mechanisms></stream:features> | |
c:<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> | |
s:<proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/> | |
-- now the client has wrapped the Conn in a tls.Conn and is handshaking, the remained is unreadable. | |
....y...u..Mx&[email protected]^.t.?....od..4./.....5. | |
.........2.3.8.9...........4.:.........................talk.google.com....;...F..Mx&..0...jl..#.p..... .i..W..aTX Mx&.Z.?A.;......Z!.k...<.e......./...........0...0..H........?.0 | |
..*.H.. | |
.....0N1.0...U....US1.0...U. | |
..Equifax1-0+..U...$Equifax Secure Certificate Aut |
This file contains hidden or 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
func DialGTalk(username, password string) (io.ReadWriteCloser, os.Error) { | |
return authenticate(starttls(net.DialTCP("tcp", nil, "talk.google.com:5222"), username, password) | |
} | |
This file contains hidden or 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
package xmpp | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"crypto/tls" | |
"xml" | |
) |
This file contains hidden or 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
package main | |
import "testing" | |
var ( | |
array [1000000]int | |
slice = make([]int, 1000000) | |
Map = make(map[int]int) | |
r int // to avoid the compiler optimising away the access | |
) |
This file contains hidden or 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
package main | |
import ( | |
"runtime" | |
"fmt" | |
"time" | |
"net" | |
) | |
func print() { |
This file contains hidden or 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
package main | |
import ( | |
"runtime" | |
"fmt" | |
"time" | |
) | |
func stats() { | |
for { |
This file contains hidden or 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
package main | |
import ( | |
"log" | |
"net" | |
"os" | |
) | |
type worker struct { | |
conn *net.UDPConn |
OlderNewer