473,569 Members | 2,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to send and receive internet messages using socket?

How do I send and receive internet messages using socket in the .net VC++ environment?
Coding sample will be helpful.
Nov 17 '05 #1
1 2925
it's complex,
you need to have an application that 'listens' and another that 'sends'.
in most cases you'd be speaking of the 'server' and the 'client'
respecvively.
in most cases you'd involve, not always but mostly, multi threading.

the code is too big to attach and protected by an NDA, ouch....
so all I can tell you is...
client and server must initialize the socket system with
WSAStartup(&mys truct);
the server needs to grab a socket(), listen() and accept().
accept() will wait until a new client connection has come...
the client will simply connect()....

when these two codes are made and running....
it's up to you, you can send anything you want, but remember in sockets you
can not send packets bigger than X size, defined using the ioctl() function,
generally in windows a maximum packet size if 8K, but use some code to see
this dynamically.
"Kueishiong Tu" <ks****@seed.ne t.tw> wrote in message
news:C4******** *************** ***********@mic rosoft.com...
How do I send and receive internet messages using socket in the .net VC++ environment? Coding sample will be helpful.

Nov 17 '05 #2

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

Similar topics

0
268
by: Kueishiong Tu | last post by:
How do I send and receive internet messages using socket in the .net Vc++ environment Coding samples will be very helpful?
1
5358
by: Kitchen Bin | last post by:
Hi. I am trying to use Sockets to do multiple Send and Receives via HTTP (not simultaneously). A first pair of Send/Receives works fine and sure enough I receive HTML back, but the next Send/Receive pair (even if identically the same as the first pair) returns no data. eg. The following simplified code will receive some bytes:...
1
3340
by: Alfred B. Thordarson | last post by:
Hi All. I have this weird problem that on my devlepment machine (Windows XP) I don't receive MultiCast messages that I send from my machine. This means that my two processes can't communicate using MultiCast if they both run on the same machine. I have created a small MultiCast "server" which is listening for messages on 224.100.0.1:8932...
6
6487
by: PHLICS_Admin | last post by:
Hi All, There are two network cards in one computer (named A) , and there is one network card in another computer(named B). On computer A: one network card is used to connect to internet, and the other network card is used in intranet whose ipaddress is 192.168.0.1 On computer B: the network card's ipaddress is 192.168.0.2. These two...
1
7816
by: Steve | last post by:
Please take a look at the simple code segment below and advise me what is wrong. According to the help and examples I've seen it should work unless I misunderstand something. The problem is that UdpClient.Receive method always throws following exception, even though I verified that message was successfuly received by devices and responses...
13
8064
by: Manfred Braun | last post by:
Hi All, I am trying to understand the blocking method socket.Send(). The call blocks as expected, but does this mean, it returnes after the underlying TCP layer got a confirmation, that the send data was received by the socket on the remote end? Can I count on that? Do I understand TCP correctly in that, it gives confirmation ? I do not...
11
7684
by: hazz | last post by:
smtpClient.Send(message) is causing me problems as per specifics in the trace below. Email is sent but not without this error typically upon sending the second email, but sometimes when running the app, even the first time. The application will be required to be sending out repeated emails, about one every second or two. Must this be...
3
4277
by: BuddyWork | last post by:
Hello, Could someone please explain why the Socket.Send is slow to send to the same process it sending from. Eg. Process1 calls Socket.Send which sends to the same IP address and port, the receiver is running within Process1. If I move the receiver into Process2 then its fast. Please can someone explain.
0
3151
by: Buddy Home | last post by:
There is two examples of code. Example 1. Send and Receive within the same process. Put this code in a console app called SendAndReceive and run the code. using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Runtime.Serialization.Formatters.Binary;
0
7922
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. ...
0
8119
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...
1
7668
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...
0
6281
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...
0
5218
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...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
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
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
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...

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.