Skip to content

Commit

Permalink
registry storage to refactor
Browse files Browse the repository at this point in the history
++

refactoring 2 simplify code is in progress

socket, service, route, transport looks like ready

multiplexer simplificatin in progress

620 loc cleaned up in multiplexer, 400 more left

stage1

compiles!

listener pp

no cleanup daemon required

logging

compatibility tests

Registry.Sync in much better now

chat example fixed

in progress

hurtmeplenty test passed

echo example passed

forwaring is on

better FWD handling

Freeze mointor added

Pop deadlock fixed

++
  • Loading branch information
Ilya Biin committed Jul 11, 2016
1 parent 8b06163 commit 73ec04e
Show file tree
Hide file tree
Showing 48 changed files with 3,624 additions and 1,841 deletions.
17 changes: 10 additions & 7 deletions addr.go → addr/addr.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
package astranet
package addr

import (
"encoding/base64"
"encoding/binary"
"fmt"
"errors"
"fmt"
)

type Addr struct {
network string
VHost uint64
VPort uint32
Net string
VHost uint64
VPort uint32
}

func (self *Addr) Network() string {
return self.network
return self.Net
}

func (self *Addr) String() string {
return fmt.Sprintf("%s:%d", Uint2Host(self.VHost), self.VPort)
}

func Uint2Host(h uint64) string {
if h == 0 {
return "--anyone---"
}
var src [8]byte
binary.BigEndian.PutUint64(src[:], h)
return base64.RawURLEncoding.EncodeToString(src[:])
Expand All @@ -42,4 +45,4 @@ func Host2Uint(h string) (uint64, error) {
}

var ErrEmptyHost = errors.New("Empty Hostname")
var ErrShortHost = errors.New("Short Hostname")
var ErrShortHost = errors.New("Short Hostname")
352 changes: 0 additions & 352 deletions conn.go

This file was deleted.

Loading

0 comments on commit 73ec04e

Please sign in to comment.