Re: [twsocket] OK to Receiving 2GB ?

2005-10-31 Thread David Lewis
1500 is the 'standard' MTU allocated. This is optimised for LAN

However, most internet 'optimisers' tend to adjust this value based on 
your connection so this value is prone to change. (dial-up I believe is 
recommended to have an MTU of 576)

There are programs out that that will read/set this value for you 
(http://62.172.198.79/broadband1/update/index.asp#20030131 shows one 
such program)

You should never assume to know this value beforehand though, unless you 
are sure you are dealing with a fresh windows install.

Dave

Darin McGee wrote:

About 1500 bytes give or take a few over ethernet 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Kei
Sent: Saturday, October 29, 2005 3:26 PM
To: ICS support mailing
Subject: Re: [twsocket] OK to Receiving 2GB ?

Hi!

I think I'm going to accept the reality that... TCP packets are splitted
into arbitrary sizes.. but!!!
How do I know the maximum size possible? What is the maximum size that a
packet can be? I certainly don't want to malloc 100KB for a TCP
packet...

Thanks!

David

Wilfried Mestdagh wrote:

  

Hello David,

 



Hi! I'm new to ICS!
   

  

Welcome to the group :)

 



A-B: msg hello
B-A: msg yo! how's it going?
   

  

Yes that's the way to go. Design a user made proto for what you intend 
to do.

 



If A is larger than the default buffer size (256 chars) then the A
(sender) will warn B in advance
   

  

You can do that, but is not nececary. Also you will maybe have a very 
mutch allocation / deallocation of memory and you can eventually end up



  

with fragmented memory where you have not a nice large block in it at 
the moment you need it. But it can work, just think over carefully. A 
better idea is often to make a receive buffer that grows automatically 
if (and only if) needed, and then just reuse that buffer over and over 
again. Then you have some (re)allocation in begin but then stable.

 



TWSocket will automatically split it into packets,
   

  

Winsock will split in packets as large as the MTU (around 1500 bytes).
Eventually data can (and will if high speed) arrive as 1 large packet 
but not necacarely.

 



I really want the sender side to send the 1MB file all at once, since 
I do the FileWrite() right after Receive()
   

  

No you cannot. Winsock does not respect packet boundaries, but (see 
prior paragraph) there are no megabytes TCP packets.

You have to receive all data chuncks into a buffer, and when you 
received them all then you save to file (or save every packet direct to



  

disk). There is no problem to know the moment of close the file because



  

you know the length of the data from your protocol.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Saturday, October 29, 2005, 11:01, Kei wrote:

 



Hi! I'm new to ICS!
   

  

 



I am designing a simple protocol that will be mainly used locally (as 
a database server backend)..so I'm guessing I could send up to 2GB of 
stuff without hassle (BLOBs, for example). Right now I'm just 
experimenting with the facility for two parties to effectively talk 
to each other, even with long long messages, and with binary data
  

transfer.
  

For example, for sending a message, the command is msg [text]
   

  

A-B: msg hello
B-A: msg yo! how's it going?

 



If A is larger than the default buffer size (256 chars) then the A
(sender) will warn B in advance, like this: hey! I'm gonna send you 
1 bytes of text
   

  

A-B: longmsg 1
B-A: ready msg
A-B: msg blahblahblah...blah!

 



In this case, B will be notified of the text size, then when
OnClientDataAvailable() event comes, it will malloc a bigger buffer, 
then Receive(CustomSized_Buffer, SizeHeToldMe). Similarly Im 
considering the same mechanism to send binary data. But if the file is
  


  

slightly
   

  

larger (10KB) then TWSocket will automatically split it into packets,
 



which I don't want it to do:
   

  

A-B: upload 1048576 picture.jpg
B-A: ready upload
A-B: 01001010101010.. (10720 bytes)
A-B: 1010101012.. (10720 bytes)
 



:
:
   

  

A-B: 01001010101010.. (4023 bytes)

 



I really want the sender side to send the 1MB file all at once, since 
I do the FileWrite() right after Receive()
   

  

 



Could anybody please help me on this issue?
   

  

 



Thanks!
   

  

 



David
   

  













 




--
To unsubscribe or change your settings for TWSocket mailing list please
goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
  


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Post Error?

2005-10-31 Thread David Lewis
When replying to a topic here, I received this reply (the mail seemed to 
still appear in the list though):


This is the Postfix program at host jester.tesla.co.il.

I'm sorry to have to inform you that your message could not be
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The Postfix program

twsocket@elists.org: mail forwarding loop for twsocket@elists.org



Reporting-MTA: dns; jester.tesla.co.il
X-Postfix-Queue-ID: CE8AD6580E1
X-Postfix-Sender: rfc822; [EMAIL PROTECTED]
Arrival-Date: Mon, 31 Oct 2005 08:45:36 + (UTC)

Final-Recipient: rfc822; twsocket@elists.org
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; mail forwarding loop for twsocket@elists.org



Is this a normal response?

Dave
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Post Error?

2005-10-31 Thread Francois PIETTE
 Is this a normal response?

No, it isn't.
It looks like you are sending to several recipients and one is failing. 
Looks like it is at jester.tesla.co.il.
Does it occur for all messages you are replying ?
--
[EMAIL PROTECTED]
http://www.overbyte.be



- Original Message - 
From: David Lewis [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Monday, October 31, 2005 10:11 AM
Subject: [twsocket] Post Error?


 When replying to a topic here, I received this reply (the mail seemed to
 still appear in the list though):


 This is the Postfix program at host jester.tesla.co.il.

 I'm sorry to have to inform you that your message could not be
 be delivered to one or more recipients. It's attached below.

 For further assistance, please send mail to postmaster

 If you do so, please include this problem report. You can
 delete your own text from the attached returned message.

 The Postfix program

 twsocket@elists.org: mail forwarding loop for twsocket@elists.org

 

 Reporting-MTA: dns; jester.tesla.co.il
 X-Postfix-Queue-ID: CE8AD6580E1
 X-Postfix-Sender: rfc822; [EMAIL PROTECTED]
 Arrival-Date: Mon, 31 Oct 2005 08:45:36 + (UTC)

 Final-Recipient: rfc822; twsocket@elists.org
 Action: failed
 Status: 5.0.0
 Diagnostic-Code: X-Postfix; mail forwarding loop for twsocket@elists.org



 Is this a normal response?

 Dave
 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Post Error?

2005-10-31 Thread David Lewis
It appears for all replies I make, as well as for fresh posts, such as 
this error report.

The 'to' address just reads:twsocket@elists.org

The message reaches the list, so it isn't a big problem for me. I just 
thought I'd mention it as I have no problem with any other mailers.

Dave

Francois PIETTE wrote:

Is this a normal response?



No, it isn't.
It looks like you are sending to several recipients and one is failing. 
Looks like it is at jester.tesla.co.il.
Does it occur for all messages you are replying ?
--
[EMAIL PROTECTED]
http://www.overbyte.be



- Original Message - 
From: David Lewis [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Monday, October 31, 2005 10:11 AM
Subject: [twsocket] Post Error?


  

When replying to a topic here, I received this reply (the mail seemed to
still appear in the list though):


This is the Postfix program at host jester.tesla.co.il.

I'm sorry to have to inform you that your message could not be
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The Postfix program

twsocket@elists.org: mail forwarding loop for twsocket@elists.org



Reporting-MTA: dns; jester.tesla.co.il
X-Postfix-Queue-ID: CE8AD6580E1
X-Postfix-Sender: rfc822; [EMAIL PROTECTED]
Arrival-Date: Mon, 31 Oct 2005 08:45:36 + (UTC)

Final-Recipient: rfc822; twsocket@elists.org
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; mail forwarding loop for twsocket@elists.org



Is this a normal response?

Dave
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be 



  


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] [ICS] mmorpg capacity question

2005-10-31 Thread info
Would TWserversocket, when implemented correctly, be able to run an
online game with +/- 1000 connection/players, using tcp/ip?

The Mmorpg is semi-realtime where each connection send an average of 
6 short packets ( 50bytes/packet) per second. 

My server is a 2.8 Ghz 1mb ram and needs to runs a mysql database on the
localhost as well, to store/autosave player data.

vult
www.endless-online.com
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] SocketSpy (User Made) Question...

2005-10-31 Thread Wilfried Mestdagh
Hello brock,

I'm not sure I understeand what you try to do but:

 declared separately in the unit. When i tried to remove the RemoteSocket
 declaration from
 type
 TClient = class(TWSocketClient)
  snip
 and make it a global variable when sending local and remote data at the same

You cannot. RemoteSocket is owned by TClient. Each TClient has his own
remotesocket. If you make it global there can only be 1 of it.

  for i:=0 to wSocketServer.ClientCount-1 do wSocketServer.Client
 [i].SendStr(data);

This will send data to all the clients of the server (the local ones).

  if Assigned(RemoteSocket) then
 RemoteSocket.SendStr(data2);

RemoteSocket is owned by that particular client of the server. Here you
send data2 to that particular remote socket.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Monday, October 31, 2005, 04:34, brock williams wrote:

 hi i was looking through SocketSpy source code under User Made section of
 ICS website and when i tested program i was curious about something. If i
 would like to send data (packets) to both the remote connection and local
 connection how would i do so?
  A TWSocketServer component exist on the form but it spawns the client
 declared separately in the unit. When i tried to remove the RemoteSocket
 declaration from
 type
 TClient = class(TWSocketClient)
 private
 Rcvd: string;
 Color: TColor;
 public
  RemoteSocket: TWsocket;
 Destructor Destroy; override;
 end;
 and make it a global variable when sending local and remote data at the same
 time i was not able to do so, only 1 at a time.What i'm asking is, how can I
 send data (e.g) under a button click event instead of having to send data
 only in the OnClientDataAvailable event etc.. I need to use both server and
 client sockets at literally the same time, one line under the other using
 SendStr(). I tried something like this but Remote connection took priority
 over local in sending.
  for i:=0 to wSocketServer.ClientCount-1 do wSocketServer.Client
 [i].SendStr(data);
  if (Assigned(RemoteSocket)) and (RemoteSocket  nil) then
 RemoteSocket.SendStr(data2);
  Any help would be greatly appreciated.
 --ICSNewbie05

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [ICS] mmorpg capacity question

2005-10-31 Thread Stadin, Benjamin
[EMAIL PROTECTED] wrote:

 Would TWserversocket, when implemented correctly, be able to run an
 online game with +/- 1000 connection/players, using tcp/ip?

 The Mmorpg is semi-realtime where each connection send an average of
 6 short packets ( 50bytes/packet) per second.

 My server is a 2.8 Ghz 1mb ram and needs to runs a mysql database on the
 localhost as well, to store/autosave player data.


The database will become a bottleneck if you have that much concurrent
clients. You could  use an in-memory sql table like SqlMemTable
http://www.aidaim.com/articles/dbmemtests.php#Results. I've never tested it
myself.
But the best thing would be if you only write to the mysql database for long
term storage and use your own data structure alogorithm (like an AVL tree or
red-black tree for example) - if you can avoid to use SQL. You can expect it
to be as much 100 times faster than this in-memory sql table. For example an
AVL tree can insert 100,000 records in about 100 ms compared to the 9
seconds(!) SqlMemTable needs.

Benjamin Stadin

 vult
 www.endless-online.com
 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] SocketSpy (User Made) Question...

2005-10-31 Thread ICSNewbie2005
Thanks for quick response :)
I have 1 button (TButton) on my main Delphi form and when i click that
button i send 2 different packets. 1 packet goes to local connection and
other packet go to remote connection. How would i do this then?
RemoteSocket.SendStr(data2) sends data to remote connection, how would i
send data to local socket without sending that data to remotesocket also?
I need to have flexibility somewhat like this
RemoteSocket.SendStr(packet2);
LocalSocket.SendStr(packet1);
all under button events, or anywhere else i choose to call it on the form.
Any ideas...
 --ICSNewbie05
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] SocketSpy Specific

2005-10-31 Thread ICSNewbie2005
Wilfried,
ty for quick response, i hope this gets to the mailing list as my last
message has not posted. Maybe i can better explain what i'm talking about in
better details.
 I have socketspy open on my PC and i'd like to send one specific packet to
local connection and one specific packet to remote connection quite
frequently. I wrote a quick bouncer using TClientSocket and TServerSocket
and it worked fine for me like this.
 Procedure TForm1.Button1Click(Sender: TObject);
var i: integer;
begin
for i := 0 to ServerSocket1.Socket.ActiveConnections -1 do
ServerSocket1.Socket.Connections[i].SendText(Packet1);
ClientSocket1.Socket.SendText(Packet2);
end;
 This means that remote socket and local socket both get their own (unique)
packets and I can call the methods of both the client and the server sockets
anywhere on my form, in any event handler.
 I am trying to do exact same thing with ICS TWSocket using the SocketSpy
source code that Wilfried has written. So what i'm asking is how can i send
data to remote and local connections without conflicts so that i can send
data to whichever connection, local or remote, any time i need to in any
form event.
 Thanks,
ICSNewbie05
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be