> now, what kind of type can i send by socket?
> can i send arrays or objects ? or only string?

Socket, at the lowest level, are only able to send/receive bytes. Eveything
you want to send must be transformed as a byte stream.

> what is the max length for a string to be sent by socket?

The question is no as precise as it should be.
A TCP socket can transmit an unlimited quantity of data, provided the
receiving side read it. How much you can send in a single chunk at the API
level depends on a number of factors. You should design you code to be
independent of how machu bytes winsock is able to accept at one time. You
must send data as winsock accept it, and it will be accepted as the receiver
accept and acknoledge it.

A UDP socket will accept a maximum datagram size, depending on a number of
factors.

What happend on the wire depends on the hardware level. Ethernet, TokenRing,
PPP, PPPOE - to name a few - have all different limits.

Speaking about TWSocket (the socket component of ICS,
http://www.overbyte.be) has a dynamic buffer for sending data. When you call
Send method, you data is pushed into a queue and pulled when winsock is able
to send. This happend automatically in the background without having to use
a thread and without blocking your application. On the other side, when data
is received and available for reading, TWSocket trigger and OnDataAvailable
event. The application can then call Receive to get the actual data.

If you are interested, you can download ICS full source code which is
freeware.

-
[EMAIL PROTECTED]
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to