473,663 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Failed to create TWinSocketStrea m object

sanYAua007
6 New Member
Please, help me to solve such a problem:

I'm writing server-application (SA) and client-application (CA) in C++ Builder 6 under Windows OS.

In CA I'm using TClientSocket's component ClientSocketSta t and in SA TServerSocket's component ServerSocketSta t to exchange information.

On ServerSocketSta t's event OnGetSocket I initialize and start cStatThread's thread object ( class cStatThread is derived from TServerClientTh read)

Expand|Select|Wrap|Line Numbers
  1. void __fastcall TForm1::ServerSocketStatGetSocket(TObject *Sender,
  2.       int Socket, TServerClientWinSocket *&ClientSocket)
  3. {
  4.  
  5.     ClientSocketN=new TServerClientWinSocket(Socket,ServerSocketStat-> Socket;
  6.       cStatThread* sthr=new cStatThread(true,ClientSocket);
  7.       sthr->Resume();
  8. }
  9.  
This is cStatThread's constructor:
Expand|Select|Wrap|Line Numbers
  1. __fastcall cStatThread::cStatThread(bool CreateSuspended, TServerClientWinSocket* aSocket)
  2.    : TServerClientThread(CreateSuspended,aSocket) {}
  3.  
This is cStatThread's ClientExecute method:
Expand|Select|Wrap|Line Numbers
  1. ...............
  2. TWinSocketStream* statStream;
  3.     try{statStream=new TWinSocketStream(ClientSocket,5000);}
  4. //after this line I receive Exception Message "Socket must be in blocking mode". But either ServerStatSocket or ClientStatSocket are in blocking modes 
  5. (stThreadBlocking and ctBlocking)
  6. .................
  7.  
Maybe I've forgot something?
But the most interesting that the same code in other application does'nt make any exceptions.
Oct 17 '07 #1
0 1462

Sign in to post your reply or Sign up for a free account.

Similar topics

0
5094
by: Ambika Srinivasan | last post by:
Hi, I am getting the following error running a crystal report with VB.NET Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed. Source Error:
9
21639
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter the results in the grid. Say you filter the grid for records that have a certain condition set to "NO" (in this case a checkbox). In this scenario the search returns one result. If I then check the checkbox ("YES") and save it, I now get my message...
0
3721
by: Igor | last post by:
An error "ODBC connection to failed" is raised when I am trying to get data from a table in Microsoft Access (97, or 2000) which is actually a linked table to another table in SQL Server 7 . The exception is raised from a Web .Net app while exactly the same code works fine in Windows .Net app. That makes me thinking the issue somehow is related to security context. Anyway I do not know how to solve the problem, and any help is...
4
1823
by: Chuck Bowling | last post by:
I'm having a problem that i really don't understand. I'm new to ASP.NET and to SQL Server (MSDE). I'm trying to get a VS walkthru in the C# to work. I think the problem is permissions but I'm not sure. I've tried adding the ZEUS\ASPNET user to the server using osql with the command "EXEC sp_grantlogin 'ZEUS\ASPNET'" but it had no apparent effect. Below is the error page that was generated when I tried to build and run the site: ...
1
9441
by: jimmyfo | last post by:
Hi, I recently wrote an ASP.Net web application in VS2005 and published (using VS2005 Publish feature) it to a relatively clean machine with ASP.Net 2.0 and MDAC 2.8 installed on it. However, when I try to create my SQL connection in the code-behind, I get the following error. I tried to register the DLL using regsvr32 but that errored out saying, "dllregisterserver entry point was not found". Any ideas? Retrieving the COM class factory...
0
2142
by: Siberwulf | last post by:
I'm trying to fetch an XML document from a website through an assembly i built and attached to SQL 2005. Here is my code for the SPROC assembly: public static void fetch_FeedData(string m_URL) { SqlPipe p = SqlContext.Pipe;
1
8361
by: Don | last post by:
I'm getting the following exception displayed in the task list at design time for my project: "Code generation for property 'Controls' failed. Error was: 'Object reference not set to an instance of an object.'" I've traced the problem to a custom control I created that inherits from Inherits System.Windows.Forms.TextBox. In this custom control, I have two constructors. I'm not sure why I created the second constructor -- it was so...
2
10994
by: Rotsey | last post by:
Hi, I have a web site that uses user controls to display different formats of timesheets. I have a browse page that has prev/next buttons to browse through a set of timesheets. As I say they can be different user controls for each timesheet type.
2
3860
by: jamitwidme | last post by:
Hello everyone Can someone help me fix this problem? I am using an example from Pyro(Python Remote Object) website directly. It is the last example from http://pyro.sourceforge.net/manual/8-example.htm I have two computers to run Server and Client. ############################################
0
8436
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
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8858
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
8548
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
8634
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
7371
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, 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...
0
4182
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
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.