473,811 Members | 3,021 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2741
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.l earn.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
1867
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.
2
1324
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...
0
998
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...
0
3577
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...
5
1106
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
1
4180
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...
1
2448
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
2305
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...
0
1045
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...
0
9727
marktang
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...
0
10647
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10398
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,...
0
10133
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 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...
0
6889
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();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3865
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3017
bsmnconsultancy
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.