Solved

IRC's DCC Protocol, Help....

Posted on 1998-04-12
4
260 Views
Last Modified: 2010-04-04
I understand I need use sockets to implement IRC's DCC protocol to my program. Here is the part I dont understand.

Here is a quick explanation on how DCC Works:

Data is sent in packets, rather than dumped in a stream manner. The recipient should acknowledge each packet by transmitting the total number of bytes received as an unsigned, 4 byte integer in network byte order.

My Question: How do I send the number of bytes I have received as an unsigned, 4 byte integer?

An Answer would be greately appreciated.
0
Comment
Question by:alexpet
  • 2
4 Comments
 
LVL 1

Expert Comment

by:extreme
ID: 1361423
Your problem is to know how many bytes do you received, or how to pack this un a 4 butes unsigned integer?
0
 

Author Comment

by:alexpet
ID: 1361424
my questions is basically how to send the number of bytes recevied as a 4 byte unsigned integer?
0
 
LVL 1

Expert Comment

by:extreme
ID: 1361425
What software to manage TCP/IP are you using?. Something like DWinsock? or you are handling TCP "at Hand"?
0
 
LVL 5

Accepted Solution

by:
julio011597 earned 50 total points
ID: 1361426
What you need should be the htonl() function from the Winsock unit... at least i have it under Delphi 2.

Help on "htonl" gives:

--//--
The Windows Sockets htonl function converts a u_long from host to network byte order.

This function takes a 32-bit number in host byte order and returns a 32-bit number in network byte order.

u_long htonl (
  u_long hostlong
);

Parameters

hostlong
  A 32-bit number in host byte order.

Return Value

The htonl function returns the value in network byte order.

See Also

htons, ntohl, ntohs
--//--

HTH.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question