mirror of
https://github.com/codecat/go-enet.git
synced 2025-12-08 05:59:47 +00:00
First progress
This commit is contained in:
parent
4040f3cae2
commit
36633a3bef
17 changed files with 1250 additions and 5 deletions
19
peer.go
Normal file
19
peer.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package enet
|
||||
|
||||
// #include <enet/enet.h>
|
||||
import "C"
|
||||
|
||||
// Peer is a peer which data packets may be sent or received from
|
||||
type Peer interface {
|
||||
GetAddress() Address
|
||||
}
|
||||
|
||||
type enetPeer struct {
|
||||
cPeer *C.struct__ENetPeer
|
||||
}
|
||||
|
||||
func (peer enetPeer) GetAddress() Address {
|
||||
return &enetAddress{
|
||||
cAddr: peer.cPeer.address,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue