Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

IRC's DCC Protocol, Help....

Posted on 1998-04-12
4
Medium Priority
?
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

604 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