c# - Concerned about methods of backlogging network messages in the event of a LAN outage -


i'm working in windows 7 embedded environment, few resources left after loaded in.

there 8 different message types clients (win 7 embedded) can send server, 2 of them of high importance (the must sent after period of network outage). other 6 messages have set retry 30 seconds if there send failure.

my concern how holding these messages in memory. 2 ideas far are:

1) having threads messages trying send on sleep until network connectivity regained (this lead lot of sleeping threads if, say, network out several days).

2) writing messages unable send file, flushing file , sending each message when connectivity regained.

what i'm wondering if method 1 cause overhead, if 50 threads in 'sleep' state?

if so, should go option 2?

perhaps there's another, more clever option, haven't considered yet also.

2 of them of high importance

if case, should not rely on leaving messages in memory, consideration

if, say, network out several days

if there power loss or other restart/failure, messages lost if in ram.

i suggest serializing messages persistent store (e.g. disk). when detect network connectivity restored, check serialized messages , send them then. make sure message transmitted before deleting disk (just in case network goes down again after first detected up, before send message).


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -