473,402 Members | 2,055 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,402 software developers and data experts.

Failed to create TWinSocketStream object

sanYAua007
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 ClientSocketStat and in SA TServerSocket's component ServerSocketStat to exchange information.

On ServerSocketStat's event OnGetSocket I initialize and start cStatThread's thread object ( class cStatThread is derived from TServerClientThread)

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 1443

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

Similar topics

0
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
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...
0
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...
4
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...
1
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...
0
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...
1
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...
2
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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...
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
isladogs
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...

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.