Quote: "This is very impressive,Barnski.
Barnski && Cattlerustler
Question or request. Is there or could you implement options to switch on and off TCP Flags like SYN/ACK,PSH,URG,FIN,RST"
Thanks, though I think I can't follow your request. I ve been spending time yesterday to find out how to set TCP flags on packets, but I think there is no way to do so. You know I am using Winsock's TCP protocol, that means Winsock makes up the IP and TCP header. Then all I add is the packet data.. the body. There is no way to change the TCP header in that way.
I could send OOB (out-of-bound) data, but I am not sure if that is what you wanted. Setting TCP flags manually results nearly in the same as coding the whole TCP protocol (unless you want to make DoS attacks).
Quote: "I have a question. Can this plugin work alongside other plugins such as multisync?"
I am not quite sure what you are asking for, I see 3 interpretations of your question:
1. can a dbp program that uses your new winsock plugin communicate with another dbp program that uses another winsock plugin?
-Yes, since my Plugin allows you to access and change all the packet data (while soon providind some easier functions).
2. can I have both winsock plugins in the user-plugins folder of my compiler, and then only use one in my code?
-Yes, I think so. Since the compiler wont link the dll that is not used.
3. Can I use both plugin commands in my code?
-No, I don't think so, and besides, I do not see a reason why to do so. But maybe it works, I am not sure how winsock will react to this (you cannot mix connection commands of course, say, connect with my plugin, and then use anothers plugin to send data on that connection).
Now for the new commands I am planing, here is a sketch of their functionality. Tell me if you don't like somethin.
new send commands:
winsock make packet --- will advice the dll to initialize a new packet.
winsock add byte (a_byte) --- 1 byte (character) - in dbp: integer 0-255
winsock add word (a_word) --- 2 bytes (short integer) - in dbp: integer 0-65535
winsock add int (an_int) --- 4 bytes - normal signed integer
winsock add float (a_float) --- 4 bytes - normal float
winsock add string (a_string) --- x+1 bytes, where x is the length of the string.
winsock send packet (a_channel) --- sends the packet on that channel
new receive commands (read commands move read cursor):
winsock split data (a_channel) --- splits the received data into packets (after haveing called winsock recv message, needs data to be sent using the "winsock send packet" command).
winsock fetch packet (a_channel) --- tells the dll to work on this first packet on that channel now.
integer = winsock packet len() --- tells you the length of this packet in bytes.
integer = winsock read byte() --- reads a byte of the packet.
integer = winsock read word() --- reads two bytes of the packet.
integer = winsock read int() --- reads 4 bytes of the packet.
float = winsock read float() --- reads 4 bytes of the packet.
string = winsock read string() --- reads x+1 bytes of the packet, where x is the length of the string.
integer = winsock packet count(a_channel) --- will show the amount of UNREAD packets. read packets will vanish, so you would fetch packets until this command returns 0.
Some more might be added, as I see the need for...
Ok, I think that these commands represent the way how you should work with packets. In every packet you will first want to write a byte or two (using the new commands) to specify the type of the packet, so that the receiver (your other program) will be able to identify the packet and know what to do with it/ what data to read from it.
edit: so a sample code to receive data in a program would look like this:
WINSOCK REFRESH CHANNEL my_channel
if WINSOCK CHANNEL DATA WAITING(my_channel)
WINSOCK RECV MESSAGE my_channel
WINSOCK SPLIT DATA my_channel
while (WINSOCK PACKET COUNT(my_channel) > 0)
WINSOCK FETCH PACKET my_channel
`now we can read data
packet_type = WINSOCK READ BYTE()
endwhile
endif
greets,
Barnski.