Repository navigation
Raw Send and Receive
Qriist edited this page Sep 16, 2026
·
1 revision
RawSend and RawReceive operate at the protocol level, below HTTP. Use them for direct TCP data exchange where you need to control the byte stream yourself.
CONNECT_ONLY is required. It tells libcurl to establish the connection without performing a full HTTP transfer:
curl.SetOpt("URL", "127.0.0.1:12345")
curl.SetOpt("CONNECT_ONLY", 1)
curl.Sync()
; connection is now established, ready for raw I/ORawSend transmits a single chunk of data. Accepts all common AHKv2 types:
curl.RawSend("fingers crossed")
msg := { status: "ok", seq: 42 }
curl.RawSend(msg)
buf := Buffer(1024, 0)
curl.RawSend(buf)RawReceive returns a Buffer. You are responsible for handling transmission delays. Loop until data arrives:
Loop {
replyBuffer := curl.RawReceive()
} Until (replyBuffer.size != 0)
; Once data starts flowing, RawReceive gathers the full message before returning
text := StrGet(replyBuffer, "UTF-8")curl.SetOpt("URL", "127.0.0.1:12345")
curl.SetOpt("CONNECT_ONLY", 1)
curl.Sync()
curl.RawSend("hello")
Loop {
replyBuffer := curl.RawReceive()
} Until (replyBuffer.size != 0)
MsgBox StrGet(replyBuffer, "UTF-8")Note: Unlike
Synctransfers, there is no built-in timeout or retry. The caller manages pacing, framing, and message boundaries.
- WebSocket — framed protocol-level messaging over the same raw transport
- Easy Handle Reference — full method list
Foundations
Operations
- Download Modes
- Setting and Listing Options
- Setting and Inspecting Headers
- POST and Upload
- Multiple Easy Handles
- Async and Multi Interface
- URL Construction
- Share Interface
- MIME and Multipart
- Raw Send and Receive
- Pause and Resume
- WebSocket
- SSL Sessions
- Debug and Diagnostics
API Reference
- Easy Handle Reference
- Multi Handle Reference
- Share Handle Reference
- MIME Handle Reference
- URL Handle Reference
- Utility Methods Reference
- WebSocket Reference
Code Snippets