mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
Strip some dead code
This commit is contained in:
parent
ef04331b86
commit
88817dc53f
@ -75,8 +75,6 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
|
||||
var mtx sync.RWMutex
|
||||
sockets := make(map[string]*socket.Socket)
|
||||
|
||||
log.Info("New socket")
|
||||
|
||||
for {
|
||||
var msg transport.Message
|
||||
if err := sock.Recv(&msg); err != nil {
|
||||
@ -103,16 +101,10 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
|
||||
psock, ok := sockets[id]
|
||||
mtx.RUnlock()
|
||||
|
||||
log.Infof("Got socket %v %v", id, ok)
|
||||
|
||||
// got the socket
|
||||
if ok {
|
||||
// accept the message
|
||||
if err := psock.Accept(&msg); err != nil {
|
||||
log.Infof("Accept Error %+v", err)
|
||||
// close the socket
|
||||
psock.Close()
|
||||
|
||||
// delete the socket
|
||||
mtx.Lock()
|
||||
delete(sockets, id)
|
||||
@ -149,8 +141,6 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
|
||||
// get the message from our internal handler/stream
|
||||
m := new(transport.Message)
|
||||
if err := psock.Process(m); err != nil {
|
||||
log.Infof("Process Error %+v", err)
|
||||
|
||||
// delete the socket
|
||||
mtx.Lock()
|
||||
delete(sockets, id)
|
||||
@ -287,8 +277,6 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
|
||||
delete(sockets, id)
|
||||
mtx.Unlock()
|
||||
|
||||
psock.Close()
|
||||
|
||||
// once done serving signal we're done
|
||||
if s.wg != nil {
|
||||
s.wg.Done()
|
||||
|
@ -123,16 +123,6 @@ func (s *Socket) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Indicates its closed
|
||||
func (s *socket) Done() bool {
|
||||
select {
|
||||
case <-s.closed:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// New returns a new pseudo socket which can be used in the place of a transport socket.
|
||||
// Messages are sent to the socket via Accept and receives from the socket via Process.
|
||||
// SetLocal/SetRemote should be called before using the socket.
|
||||
|
Loading…
Reference in New Issue
Block a user