mirror of
https://github.com/statbate/supreme-disco.git
synced 2026-08-11 03:22:41 +00:00
update
This commit is contained in:
parent
db66cde2fe
commit
89f19d68cc
2 changed files with 38 additions and 11 deletions
|
|
@ -3,19 +3,38 @@ package main
|
|||
import (
|
||||
"net"
|
||||
"time"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var echoSocket = make(chan []byte)
|
||||
|
||||
func startSocket() {
|
||||
|
||||
var(
|
||||
err error
|
||||
conn net.Conn
|
||||
)
|
||||
|
||||
for {
|
||||
select {
|
||||
case b := <-echoSocket:
|
||||
conn, err := net.Dial("unix", "/tmp/echo.sock")
|
||||
if err == nil {
|
||||
conn.Write(b)
|
||||
conn.Close()
|
||||
|
||||
if conn == nil {
|
||||
conn, err = net.Dial("unix", "/tmp/echo.sock")
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if conn != nil {
|
||||
if _, err = conn.Write(b); err != nil {
|
||||
fmt.Println(err.Error())
|
||||
conn.Close()
|
||||
conn = nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -24,8 +43,8 @@ func main() {
|
|||
go startSocket()
|
||||
|
||||
for {
|
||||
echoSocket <- []byte(`{"chanel":"stripchat","room":"naughtyobsessions","donator":"tbone6893","amount":333}`)
|
||||
echoSocket <- []byte(`{"chanel":"stripchat","index":28}`)
|
||||
echoSocket <- []byte(`{"chanel":"chaturbate","room":"naughtyobsessions","donator":"tbone6893","amount":333}`)
|
||||
echoSocket <- []byte(`{"chanel":"chaturbate","index":28}`)
|
||||
time.Sleep(1e9)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue