| | |
| | | |
| | | // create server |
| | | func NewSocketListen(mode int, url string, shm bool) (socket SocketContext, err error) { |
| | | logger.Info("url is: ", url) |
| | | ctx, cancel := context.WithCancel(context.Background()) |
| | | |
| | | socket.Context = ctx |
| | |
| | | func MaybeRestartSocket(socket SocketContext, tryCnt *int) SocketContext { |
| | | if socket.UseSHM { |
| | | if *tryCnt > ShmMaxTryCount { |
| | | logger.Info("SDK SEND SHM TRY :", ShmMaxTryCount, " RESTART IT") |
| | | logger.Info("SDK SEND SHM TRY :", ShmMaxTryCount, " RESTART: ", socket.URL) |
| | | |
| | | socket.Sock.Close() |
| | | newSocket, err := NewSocketListen(socket.Mode, socket.URL, socket.UseSHM) |