473,890 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Issue with Sopen() and dropping a network connection.

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
Any ideas would be helpful.

Jul 19 '05 #1
1 2745
Kim Hamilton wrote:
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.


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:
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.l earn.c-c++ faq:
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

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 run the Access on their Win XP OS, and installed the ODBC MySQL Driver 3.51. When I test the connection in the ODBC panel, CONNECTED ! Then I open MS Access, and great, the app works.
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 night before and is maintaining its back-end connection. A backup copy can still be made but the compression, of course, cannot be done. In general, its easy to find the PC and correct the problem. Often, however, with no PCs connected to the...
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 their connection. The dropping of connections will be based on varying conditions that will change very often. Also, I do not control the application that is listening for these connections. Is there a way to get in between the OS and the...
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 host is on a Unix server. I'm using the FtpWebRequest and FtpWebResponse classes to do the file uploading. I have tested it without any errors at all uploading to an IIS FTP server hosted on our network Most of the time it uploads without error to...
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 of cookieless to true Anyone from any IP address or across another browser can copy the URL and work within the session. My question is "Why doesn't ASP.Net provide an option around ensuring
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 "System DSN" in the ODBC configuration tool (MS). When In server Explorer, I click on my connection object and then select properties to get the connection information. I then copy this connection information and place it into a string object so...
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.
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 connection, the connection will succeed. However, upon closing the connection dialog box, the database temporarily connects and then drops. This happens for both Access 2k and Access 2003. I spent Thursday and Friday trying to get things back to...
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) that makes a connection to Windows servers using WNetAddConnection2() to perform various functions. I don't have the ability to modify that code for that binary but I must use it. My requirement is that I establish a dial-up connection to the...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.