473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Issue with Sopen() and dropping a network connection.

Hello,
I'm using a C++ program to write out a file using sopen(). The file is
pointed to a network drive. Some times the network goes down, and the file
errors out. Is there
any way to spool the file locally, and when the network returns, rewrite the
file out
to the network ? I can probably write some code to do all of that, but
didn't know
if there were any API calls, say setting to output file as a print spool
type.
Any ideas would be helpful.

K.Hamilton
Jul 19 '05 #1
1 2715
Kim Hamilton wrote:
Hello,
I'm using a C++ program to write out a file using sopen(). The file is
pointed to a network drive. Some times the network goes down, and the file
errors out.

Is there any way to spool the file locally, and when the network returns,
rewrite the file out to the network ?
Most likely, yes. You will have to investigate all the networking
features that your platform provides. Networking is not part of the
_standard_ C++ language, so not discussed here.

I can probably write some code to do all of that, but
didn't know if there were any API calls, say setting
to output file as a print spool type.
Any ideas would be helpful.

K.Hamilton


You need to set up a "spool" or queue and also detect when the
network is "up" and when it is "down". If the network is up,
the service routine (or spooler) would send out a packet
from the current file. If the transmission was successful,
it would send out the next file. The service routine would
perform an infinite retry on the network.

Look at your platform specific "sopen" function for a
time-out parameter. Try setting it to the maximum.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David | last post by:
Hi, I have a local user on our network running MS Access 2003 (on Win XP Home), which needs to connect to a Back-End MySQL DB on our Cobalt Qube 3 Server. I installed the correct software to...
2
by: Hank Reed | last post by:
Every morning a script starts up one of my network PCs at 5:00 AM. The first PC on the database each day runs compression and backup. Works great. A problem occurs if one PC did not shut down the...
0
by: Amy L. | last post by:
I would like to write some kind of service that runs in the background and monitors incoming connections to my server. Depending on the IP address connecting to the box I may want to terminate...
0
by: Kevin Spencer | last post by:
Hi all, I am working on a service that uploads METAR weather information to the National Weather Service FTP site. The service I'm authoring is hosted on a Windows 200 server, and the NWS FTP...
5
by: Keith | last post by:
I have found what I believe to be a serious security issue in ASP.Net. If you have: 1. Your website configured for anonymous access 2. Elect under web.config to set the sessionstate attribute...
1
by: OldButStillLearning | last post by:
OK, I am trying to connect to DB2 (z/OS). I have successfully made the connection to the database in the Server Explorer. I am also able to successfully log in to DB2 when I am testing the...
1
by: rijesh | last post by:
Hi all Is there any function called sopen in C. if it so can any oneexplain me the useage of that function and the syntax.
2
by: CriticalJ | last post by:
I have several projects that have been working for at least four years. Last Thursday, the connections for these projects began dropping immediately upon opening the project. When I test the...
0
by: cypher_key | last post by:
I don't believe this problem is specially related to C#, but since my app is written in that language I thought this would be a good place to start. I have a binary written in C++ (not by me)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.