473,714 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asynchronous socket communication

Hello,
I can't manage with asynchronous socket communication. :(
I wrote a class CSocket.cs.
This class is taking care of sending strings to LED display. This
display is actually communicating via serial port and serial/ethernet
converter (MOXA NE-4100T) with TCP server. So communication is in that
way:

MyApplication(T CP
client)-----------------(TCPServer)MOXA (serial)---(serial)LED Display

In the constructor there are three parameters:
public CSocket(IPAddre ss p_ipAddress, int p_port, ArrayList
p_arrayToSend)

The array is array of strings that are valid for special LED display
protocol. The server is giving reply OK or BAD if the string it
received is display

protocol valid (syntax, crc etc).
The main public method of that class is
public void ConnectAndSend( )
{
if (this.m_status != EStatus.Connect ed)
{
res = this.SequenceCo nnect();
}

this.m_iTriedSe nd = 0;
if (this.m_status = EStatus.Connect ed)
{
while(counter<p _arrayToSend.Le ngth || this.m_iTriedSe nd <
REPEATSEND)
{
Send(CurrStrFro mArray);
this.m_iTriedSe nd++;
if (this.m_status= =EStatus.Receiv ed) counter++;
}
}
}
This is only abstract of that method to give general idea.
The SequenceConnect tries to connect using Socket.BeginCon nect methd.
When connection is established OnClientConnect method is called to call
Socket.EndConne ct method.
This process I wanted to have in the ConnThread . When the thread is
finished (connection established or not) the main thread can go further
to send data (or not)

The same idea idea is with sending the strings to TCP server. When the
data is sent ReceiveThread is launched to wait for the reply and when
there is response from the server, the main thread will keep on sending
following strings.

Here is most important part of the code. I hope names are clear enough

private void SequenceConnect ()
{
this.m_iTriedCo nnect = 0;
while (this.m_iTriedC onnect < REPEATCONNECT)
{
ThreadStart privThreadDeleg = new ThreadStart(Try Connect);
Thread ConnThread = new Thread(privThre adDeleg);
ConnThread.Star t();
// wait until thread finish or time elapses
ConnThread.Join (TIME_ELAPSED);
if (this.m_status == EStatus.Connect ed) break;
}
}

public void TryConnect()
{
this.m_iTriedCo nnect++;
try
{
IPEndPoint remoteEndPoint = new
System.Net.IPEn dPoint(this.m_i pAddress, this.m_iPort);
this.m_socketCl ient.BeginConne ct(remoteEndPoi nt,new AsyncCallback (
OnClientConnect ),null);
this.m_status = EStatus.Connect ing;
}
catch (SocketExceptio n e)
{
else this.m_status = EStatus.ConnErr or;
}
return;
}

private void OnClientConnect (IAsyncResult asyn)
{
try
{
this.m_socketCl ient.EndConnect (asyn);
if(this.m_socke tClient.Connect ed) this.m_status = EStatus.Connect ed;
else this.m_status = EStatus.ConnErr or;
}
catch (SocketExceptio n e)
{
else this.m_status = EStatus.ConnErr or;
}
return;
}

private void Send(string p_stringToSend)
{
this.m_status=E Status.Sending;
try
{
Object objData = p_stringToSend;
byte[] byData = Encoding.ASCII. GetBytes(objDat a.ToString ());
this.m_socketCl ient.Send (byData);
this.m_status = EStatus.Sent;

ThreadStart privThreadDeleg = new ThreadStart(Wai tForData);
Thread ReceiveThread = new Thread(privThre adDeleg);
ReceiveThread.S tart();
// wait until thread finish or time elapses
ReceiveThread.J oin(TIME_ELAPSE D);
}
catch (SocketExceptio n e)
{
this.m_status = EStatus.SendErr or;
}
return;
}

private void WaitForData()
{
this.m_status = EStatus.Receivi ng;
try
{
IAsyncResult m_asynResult =
m_socketClient. BeginReceive(m_ bDataBuffer,0,8 ,SocketFlags.No ne,pfnCallBack, null);
}
catch (SocketExceptio n e)
{
this.m_status = EStatus.Receive Error;
}
return;
}

private void OnDataReceived( IAsyncResult asyn)
{
try
{
int iRx = 0;
iRx = m_socketClient. EndReceive(asyn );
char[] chars = new char[iRx + 1];
Decoder d = Encoding.UTF8.G etDecoder();
this.m_iCharLen = d.GetChars(m_bD ataBuffer, 0, iRx, chars, 0);
this.m_Received = new String(chars);
this.m_status = EStatus.Receive d;
}
catch (SocketExceptio n e)
{
this.m_status = EStatus.Receive Error;
}
return;
}
The problem I found here is that application doesn't stop until
ConnThread is finished. Main thread passes
"ConnThread.Joi n(TIME_ELAPSED) ;" and goes to next statement which is
"if (this.m_status == EStatus.Connect ed) break;" while the value is
Connecting - so next loop is done. How can I prevent it?
Sometimes main thread is waiting for "ConnThread.Joi n(TIME_ELAPSED) ;"
statement.
I don't understand why. Does AsyncCallback start a new thread?
I think I have some problem with threading here.
Or maybe you know some better way/idea to solve that kind of
communication.

Regards,
panko

Jan 25 '07 #1
8 4581
Hi,

Well that's a fair amount of code let me tell you. Did you try a sync
connection first?

"panko" <PK*******@gmai l.comwrote in message
news:11******** **************@ j27g2000cwj.goo glegroups.com.. .
| Hello,
| I can't manage with asynchronous socket communication. :(
| I wrote a class CSocket.cs.
| This class is taking care of sending strings to LED display. This
| display is actually communicating via serial port and serial/ethernet
| converter (MOXA NE-4100T) with TCP server. So communication is in that
| way:
|
| MyApplication(T CP
| client)-----------------(TCPServer)MOXA (serial)---(serial)LED Display
|
| In the constructor there are three parameters:
| public CSocket(IPAddre ss p_ipAddress, int p_port, ArrayList
| p_arrayToSend)
|
| The array is array of strings that are valid for special LED display
| protocol. The server is giving reply OK or BAD if the string it
| received is display
|
| protocol valid (syntax, crc etc).
| The main public method of that class is
| public void ConnectAndSend( )
| {
| if (this.m_status != EStatus.Connect ed)
| {
| res = this.SequenceCo nnect();
| }
|
| this.m_iTriedSe nd = 0;
| if (this.m_status = EStatus.Connect ed)
| {
| while(counter<p _arrayToSend.Le ngth || this.m_iTriedSe nd <
| REPEATSEND)
| {
| Send(CurrStrFro mArray);
| this.m_iTriedSe nd++;
| if (this.m_status= =EStatus.Receiv ed) counter++;
| }
| }
| }
| This is only abstract of that method to give general idea.
| The SequenceConnect tries to connect using Socket.BeginCon nect methd.
| When connection is established OnClientConnect method is called to call
| Socket.EndConne ct method.
| This process I wanted to have in the ConnThread . When the thread is
| finished (connection established or not) the main thread can go further
| to send data (or not)
|
| The same idea idea is with sending the strings to TCP server. When the
| data is sent ReceiveThread is launched to wait for the reply and when
| there is response from the server, the main thread will keep on sending
| following strings.
|
| Here is most important part of the code. I hope names are clear enough
|
| private void SequenceConnect ()
| {
| this.m_iTriedCo nnect = 0;
| while (this.m_iTriedC onnect < REPEATCONNECT)
| {
| ThreadStart privThreadDeleg = new ThreadStart(Try Connect);
| Thread ConnThread = new Thread(privThre adDeleg);
| ConnThread.Star t();
| // wait until thread finish or time elapses
| ConnThread.Join (TIME_ELAPSED);
| if (this.m_status == EStatus.Connect ed) break;
| }
| }
|
| public void TryConnect()
| {
| this.m_iTriedCo nnect++;
| try
| {
| IPEndPoint remoteEndPoint = new
| System.Net.IPEn dPoint(this.m_i pAddress, this.m_iPort);
| this.m_socketCl ient.BeginConne ct(remoteEndPoi nt,new AsyncCallback (
| OnClientConnect ),null);
| this.m_status = EStatus.Connect ing;
| }
| catch (SocketExceptio n e)
| {
| else this.m_status = EStatus.ConnErr or;
| }
| return;
| }
|
| private void OnClientConnect (IAsyncResult asyn)
| {
| try
| {
| this.m_socketCl ient.EndConnect (asyn);
| if(this.m_socke tClient.Connect ed) this.m_status = EStatus.Connect ed;
| else this.m_status = EStatus.ConnErr or;
| }
| catch (SocketExceptio n e)
| {
| else this.m_status = EStatus.ConnErr or;
| }
| return;
| }
|
| private void Send(string p_stringToSend)
| {
| this.m_status=E Status.Sending;
| try
| {
| Object objData = p_stringToSend;
| byte[] byData = Encoding.ASCII. GetBytes(objDat a.ToString ());
| this.m_socketCl ient.Send (byData);
| this.m_status = EStatus.Sent;
|
| ThreadStart privThreadDeleg = new ThreadStart(Wai tForData);
| Thread ReceiveThread = new Thread(privThre adDeleg);
| ReceiveThread.S tart();
| // wait until thread finish or time elapses
| ReceiveThread.J oin(TIME_ELAPSE D);
| }
| catch (SocketExceptio n e)
| {
| this.m_status = EStatus.SendErr or;
| }
| return;
| }
|
| private void WaitForData()
| {
| this.m_status = EStatus.Receivi ng;
| try
| {
| IAsyncResult m_asynResult =
|
m_socketClient. BeginReceive(m_ bDataBuffer,0,8 ,SocketFlags.No ne,pfnCallBack, null);
| }
| catch (SocketExceptio n e)
| {
| this.m_status = EStatus.Receive Error;
| }
| return;
| }
|
| private void OnDataReceived( IAsyncResult asyn)
| {
| try
| {
| int iRx = 0;
| iRx = m_socketClient. EndReceive(asyn );
| char[] chars = new char[iRx + 1];
| Decoder d = Encoding.UTF8.G etDecoder();
| this.m_iCharLen = d.GetChars(m_bD ataBuffer, 0, iRx, chars, 0);
| this.m_Received = new String(chars);
| this.m_status = EStatus.Receive d;
| }
| catch (SocketExceptio n e)
| {
| this.m_status = EStatus.Receive Error;
| }
| return;
| }
|
|
| The problem I found here is that application doesn't stop until
| ConnThread is finished. Main thread passes
| "ConnThread.Joi n(TIME_ELAPSED) ;" and goes to next statement which is
| "if (this.m_status == EStatus.Connect ed) break;" while the value is
| Connecting - so next loop is done. How can I prevent it?
| Sometimes main thread is waiting for "ConnThread.Joi n(TIME_ELAPSED) ;"
| statement.
| I don't understand why. Does AsyncCallback start a new thread?
| I think I have some problem with threading here.
| Or maybe you know some better way/idea to solve that kind of
| communication.
|
| Regards,
| panko
|
Jan 25 '07 #2
Hi,
I've only read about it and some sample code and tutorials.
I don't like the idea of checking periodically if i received any answer
from the server.
I have event driven environment and I would like to take advantage of
it. :)
On Jan 25, 8:07 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions .comwrote:
Hi,

Well that's a fair amount of code let me tell you. Did you try a sync
connection first?
Jan 25 '07 #3
Hi,

"panko" <PK*******@gmai l.comwrote in message
news:11******** *************@v 33g2000cwv.goog legroups.com...
| Hi,
| I've only read about it and some sample code and tutorials.

It's simple once you know the concept, try it first with a simple
send/receive.

| I don't like the idea of checking periodically if i received any answer
| from the server.

Now that you mention that, are you sure that the connection is always open?
is it possible that it gets close after some time with out activiti?

| I have event driven environment and I would like to take advantage of
| it. :)

Of course, but even with a sync. you can do that, you can use one thread
just for the comm. and this thread send events to the UI thread when
something is changed.

In any case the sync scenario would be to test that the comm is correct, and
that the protocol is being interpreted correctly.
--
Ignacio Machin
machin AT laceupsolutions com
Jan 25 '07 #4

I understand how it works, but I would like to be notified when data
arrives.
Sync communication doesn't allow me to do that. That's why I don't like
sync.

On Jan 25, 9:10 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions .comwrote:
Hi,

"panko" <PKoper...@gmai l.comwrote in messagenews:11* *************** *****@v33g2000c wv.googlegroups .com...
| Hi,
| I've only read about it and some sample code and tutorials.

It's simple once you know the concept, try it first with a simple
send/receive.
Jan 25 '07 #5
panko wrote:
I understand how it works, but I would like to be notified when data
arrives.
Sync communication doesn't allow me to do that. That's why I don't like
sync.
A synchronous blocking TCP/IP connection only returns to the calling
program when data arrives, or the connection is closed. It is not
polling. If you want to have a responsive UI etc. with a synchronous,
blocking TCP/IP connection, then you need to use a separate thread.

However, a blocking approach in a separate thread is simpler than
asynchronous code to start with. The asynchronous approach uses threads
in the background anyway, it will call you back on a threadpool / IO
thread, so you still need to deal with synchronization issues.

-- Barry

--
http://barrkel.blogspot.com/
Jan 25 '07 #6
Hi, panko:

Do you really care for notification. If you do, take a time to look at
our SocketPro at www.udaparts.com.

See comments from our customers at
http://www.udaparts.com/groups/viewtopic.php?t=39 and real samples written
from our SocketPro at http://www.wramp.net/casestudies1.html.

SocketPro has a built-in chat (or notification) service for real-time
notification from either client or server side. See the site at
http://www.udaparts.com/document/art...hatservice.htm

If you use worker thread approach, you will NEVER get real-time
notification.

Regards,

"panko" <PK*******@gmai l.comwrote in message
news:11******** **************@ j27g2000cwj.goo glegroups.com.. .
Hello,
I can't manage with asynchronous socket communication. :(
I wrote a class CSocket.cs.
This class is taking care of sending strings to LED display. This
display is actually communicating via serial port and serial/ethernet
converter (MOXA NE-4100T) with TCP server. So communication is in that
way:

MyApplication(T CP
client)-----------------(TCPServer)MOXA (serial)---(serial)LED Display

In the constructor there are three parameters:
public CSocket(IPAddre ss p_ipAddress, int p_port, ArrayList
p_arrayToSend)

The array is array of strings that are valid for special LED display
protocol. The server is giving reply OK or BAD if the string it
received is display

protocol valid (syntax, crc etc).
The main public method of that class is
public void ConnectAndSend( )
{
if (this.m_status != EStatus.Connect ed)
{
res = this.SequenceCo nnect();
}

this.m_iTriedSe nd = 0;
if (this.m_status = EStatus.Connect ed)
{
while(counter<p _arrayToSend.Le ngth || this.m_iTriedSe nd <
REPEATSEND)
{
Send(CurrStrFro mArray);
this.m_iTriedSe nd++;
if (this.m_status= =EStatus.Receiv ed) counter++;
}
}
}
This is only abstract of that method to give general idea.
The SequenceConnect tries to connect using Socket.BeginCon nect methd.
When connection is established OnClientConnect method is called to call
Socket.EndConne ct method.
This process I wanted to have in the ConnThread . When the thread is
finished (connection established or not) the main thread can go further
to send data (or not)

The same idea idea is with sending the strings to TCP server. When the
data is sent ReceiveThread is launched to wait for the reply and when
there is response from the server, the main thread will keep on sending
following strings.

Here is most important part of the code. I hope names are clear enough

private void SequenceConnect ()
{
this.m_iTriedCo nnect = 0;
while (this.m_iTriedC onnect < REPEATCONNECT)
{
ThreadStart privThreadDeleg = new ThreadStart(Try Connect);
Thread ConnThread = new Thread(privThre adDeleg);
ConnThread.Star t();
// wait until thread finish or time elapses
ConnThread.Join (TIME_ELAPSED);
if (this.m_status == EStatus.Connect ed) break;
}
}

public void TryConnect()
{
this.m_iTriedCo nnect++;
try
{
IPEndPoint remoteEndPoint = new
System.Net.IPEn dPoint(this.m_i pAddress, this.m_iPort);
this.m_socketCl ient.BeginConne ct(remoteEndPoi nt,new AsyncCallback (
OnClientConnect ),null);
this.m_status = EStatus.Connect ing;
}
catch (SocketExceptio n e)
{
else this.m_status = EStatus.ConnErr or;
}
return;
}

private void OnClientConnect (IAsyncResult asyn)
{
try
{
this.m_socketCl ient.EndConnect (asyn);
if(this.m_socke tClient.Connect ed) this.m_status = EStatus.Connect ed;
else this.m_status = EStatus.ConnErr or;
}
catch (SocketExceptio n e)
{
else this.m_status = EStatus.ConnErr or;
}
return;
}

private void Send(string p_stringToSend)
{
this.m_status=E Status.Sending;
try
{
Object objData = p_stringToSend;
byte[] byData = Encoding.ASCII. GetBytes(objDat a.ToString ());
this.m_socketCl ient.Send (byData);
this.m_status = EStatus.Sent;

ThreadStart privThreadDeleg = new ThreadStart(Wai tForData);
Thread ReceiveThread = new Thread(privThre adDeleg);
ReceiveThread.S tart();
// wait until thread finish or time elapses
ReceiveThread.J oin(TIME_ELAPSE D);
}
catch (SocketExceptio n e)
{
this.m_status = EStatus.SendErr or;
}
return;
}

private void WaitForData()
{
this.m_status = EStatus.Receivi ng;
try
{
IAsyncResult m_asynResult =
m_socketClient. BeginReceive(m_ bDataBuffer,0,8 ,SocketFlags.No ne,pfnCallBack, null);
}
catch (SocketExceptio n e)
{
this.m_status = EStatus.Receive Error;
}
return;
}

private void OnDataReceived( IAsyncResult asyn)
{
try
{
int iRx = 0;
iRx = m_socketClient. EndReceive(asyn );
char[] chars = new char[iRx + 1];
Decoder d = Encoding.UTF8.G etDecoder();
this.m_iCharLen = d.GetChars(m_bD ataBuffer, 0, iRx, chars, 0);
this.m_Received = new String(chars);
this.m_status = EStatus.Receive d;
}
catch (SocketExceptio n e)
{
this.m_status = EStatus.Receive Error;
}
return;
}
The problem I found here is that application doesn't stop until
ConnThread is finished. Main thread passes
"ConnThread.Joi n(TIME_ELAPSED) ;" and goes to next statement which is
"if (this.m_status == EStatus.Connect ed) break;" while the value is
Connecting - so next loop is done. How can I prevent it?
Sometimes main thread is waiting for "ConnThread.Joi n(TIME_ELAPSED) ;"
statement.
I don't understand why. Does AsyncCallback start a new thread?
I think I have some problem with threading here.
Or maybe you know some better way/idea to solve that kind of
communication.

Regards,
panko

Jan 26 '07 #7
First of all - thanks for your useful reply.
According to what you recommend I will start with synchronous blocking
communication and threading.
I already use threading here in async so I hope threading in sync would
be more controllable.
Could you recommend me any sample?

By the way - I think I understand where my mistke was. My ConnThread
finishes with TryConnect method. OnClientConnect called by delegate is
new thread.
Main thread is only paying attention to ConnThread. It doesn't care if
that thread started another one or not.
On 26 Sty, 00:23, Barry Kelly <barry.j.ke...@ gmail.comwrote:
panko wrote:
I understand how it works, but I would like to be notified when data
arrives.
Sync communication doesn't allow me to do that. That's why I don't like
sync.A synchronous blocking TCP/IP connection only returns to the calling
program when data arrives, or the connection is closed. It is not
polling. If you want to have a responsive UI etc. with a synchronous,
blocking TCP/IP connection, then you need to use a separate thread.

However, a blocking approach in a separate thread is simpler than
asynchronous code to start with. The asynchronous approach uses threads
in the background anyway, it will call you back on a threadpool / IO
thread, so you still need to deal with synchronization issues.

-- Barry

--http://barrkel.blogspo t.com/
Jan 26 '07 #8
panko wrote:
First of all - thanks for your useful reply.
According to what you recommend I will start with synchronous blocking
communication and threading.
I already use threading here in async so I hope threading in sync would
be more controllable.
Could you recommend me any sample?
There is a simple sample in the Quickstart samples in the .NET SDK. This
might not be installed by default in 2.0, I believe it was in 1.1 and
before. It hasn't changed since 1.1 anyway, IIRC.

It's at <sdk-location>/QuickStart/howto/samples/net/tcpudp/cs

In there there are two relevant files, datetimeserver. cs and
datetimeclient. cs, which shows ultra-basic behaviour.

There are lots of other TCP client / server samples out there in C#. I
expect most will use the synchronous approach since it is easier to
reason about, especially when starting. With the asynchronous model, you
often have to create some kind of explicit state machine to model the
progress of a conversation.

-- Barry

--
http://barrkel.blogspot.com/
Jan 26 '07 #9

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

Similar topics

3
2818
by: Corne Oosthuizen | last post by:
I'm writing a Telnet Server application using Asynchronous sockets. I spawn a listener thread to handel incomming connections and create a separate client socket for each new connection. I then set the new client socket to BeginReceive(). My problem: When two client socket connections send data
2
2520
by: news.microsoft.com | last post by:
Hi I write dll library which one of it component will be Net socket communication. Communication is working very good, but i've got problem when client is connecting. When server is started, client is connecting without problems; but when servre is down and i start client, client connect to server! Few lines from code: client.Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
4
5430
by: Matthew Groch | last post by:
Hi all, I've got a server that handles a relatively high number of concurrent transactions (on the magnitude of 1000's per second). Client applications establish socket connections with the server. Data is sent and received over these connections using the asynchronous model. The server is currently in beta testing. Sporadically over the course of the day, I'll observe the thread count on the process (via perfmon) start climbing....
1
6149
by: Chan | last post by:
Building an Asyc Socket DLL using C#, I followed MS .NET FRAMEWORK library sample (see "Asynchronous Client Socket Example") and created a DLL called MSSock. I then reference MSSock in a .exe c# program to test it. This .exe has a form which has a button and a text field to invoke the DLL async communication and display return data. <F5>, runs ok and data returned is being displayed. Without exiting the app, click on the button again,...
9
8670
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am trying to decide if I should use remoting vs. writing a server that uses networkstreams. I have read that networkstreams\tcp programming should be faster than remoting and is a better choice for what I am doing but that it is difficult to code.
4
3820
by: taskswap | last post by:
I have a legacy application written in C that I'm trying to convert to C#. It processes a very large amount of data from many clients (actually, upstream servers - this is a mux) simultaneously. I've read through what must be dozens of ways to do socket communication in C#, and it seems they all devolve into three basic options - Socket.Select, IOCP through a native interface, and Asynchronous callbacks. I'm fine using Asynchronous...
4
3604
by: Engineerik | last post by:
I am trying to create a socket server which will listen for connections from multiple clients and call subroutines in a Fortran DLL and pass the results back to the client. The asynchronous socket client and asynchronous socket server example code provided in the .NET framework developers guide is a great start but I have not dealt with sockets before and I am struggling with something. From what I can tell the sample server code ...
1
6678
by: Alper AKCAYOZ | last post by:
Hello, I have developped asynchronous socket communication with blocking Socket commands (accept, connect, send, receive) by using threads on Windows .NET Forms. It is working properly. Now I want to code the similar program with Asynchronous Socket commands of .NET using Managed C++ on Windows .NET Forms. My problem is with delegates. I have to use "static" methods as parameter in delegate constructor like below:...
2
3433
by: Nicolas Le Gland | last post by:
Hello everyone here. This is my first post in this newsgroup, I hope I won't be to much off-topic. Feel free to redirect me to any better group. I am getting strange timing issues when failing to asynchronously connect sockets on closed or filtered ports, but I'm quite unsure if this is a PHP issue or my misunderstanding, as it seems that socket streams only wrap around <sys/socket.h>.
0
8796
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
9307
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...
0
9170
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 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...
0
9009
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
7946
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
5943
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
4715
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3155
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
2
2514
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.