Search:
Type: Posts; User: HouseMD93
Search:
Search took 0.03 seconds.
-
September 4th, 2009, 07:47 AM
Well, i rly like your code but... Most servers currently need TLS/SSL support, which i do not know how to implement.
-
August 26th, 2009, 01:51 PM
I understand then that the method i've been using leads me nowhere. But what do you mean by 2) ?? I use this usually char buffer[100] but i can read it into a string anyway with this:
...
-
August 26th, 2009, 09:33 AM
I edited the script a little so it either chooses len or until.
string get(char buffer[],int from, int until, int len)
{
int end = min(until,len-from);
return string( buffer+from , buffer+end...
-
August 26th, 2009, 09:09 AM
crash using 4), std::bad_alloc -_-
-
August 26th, 2009, 07:33 AM
What? Binary data? What can i use then (You do realize after the chars of 0 1 2 3 4 etc) i do get letters so what do i use? Even appending correct letters 1 at a time doesn't work :( What the hell!
-
August 26th, 2009, 07:01 AM
I am using sockets to receive, so len is len the real length. The reason why i use len in the first place, is because the characters i receive are for example the char of 0. I shall try again but i...
-
August 25th, 2009, 04:50 PM
string get(char buffer[],int from, int until, int len)
{
return string(buffer,from,until);
}
It gives me some weird handling exception: std::out_of_memory!?
I thought strings can take up...
-
August 24th, 2009, 11:16 AM
Ok thanks, although i have to rewrite every piece of code i have written. Atleast this way i won't get a memory leak.
-
August 24th, 2009, 10:55 AM
Will it be ok if I use char instead of the pointer: char*?
Will that also cause a memory leak?
-
August 24th, 2009, 10:33 AM
Another problem:
What happens if you do
printf(get(...para's))
-
August 24th, 2009, 10:23 AM
-
August 24th, 2009, 10:00 AM
char* get(char buffer[],int from, int until, int len)
{
int a = from;
int b = 0;
int end = from+until;
char *lol;
lol = new char[until+1];
while (a < len && a <= end) {
lol[b] = buffer[a];...
-
July 29th, 2009, 02:46 PM
Weird... Doing it like that, i get a bunch of -1's for recv (I am using select command to detect if its time to receive) and sometimes 2 and 1 etc... So i am not sure whats going on...
-
July 29th, 2009, 02:39 PM
Thanks for the info. Btw, by doing setting the limit to 4 each time, Wouldn't that mean i will not know the end of the message; Assuming i get, for example, 2 messages sent to me at once?
The way...
-
July 29th, 2009, 01:32 PM
I used connect to bind the ip address and port to the socket, so i wouldn't have to use recvfrom but just recv.
Anyway, i did the second one: recv(socket,(char *)&i,sizeof(i),0) already which gave...
-
July 29th, 2009, 10:55 AM
Ok i try to provide more info, but i am not sure why you would need more. Anyway, here goes:
The sender is sending information like this: mertea (for example) and each number of those letters...
-
July 28th, 2009, 04:40 PM
I am using an integer to receive values from sockets (recv). But i need them as ascii values, but they need to be able to go higher than 255, which is the reason i cannot use char for the recv.
So...
-
July 28th, 2009, 10:35 AM
That may be so, but i have given u enough clues. I used char buffer[size] for recv and used buffer[0] etc to interpret the message eg if (int)buffer[0] == 2 { eat_kellogs; }
One piece of...
-
July 28th, 2009, 05:00 AM
I found that doing this: printf("%d %d %d %d",buffer) using int to receive it, would print out many numbers which are different, more specifically the other values received, so now it would be nice...
-
July 27th, 2009, 06:08 PM
basically, it was sent like this (putting it in a printf way).
printf("%c%c%c%c",0,1,2,3) for example and each number means something, which the program is supposed to interpret.
ofcourse i...
-
July 27th, 2009, 05:00 PM
Problem: I cannot use it as an array? how can i get the data? as the program i have sends numbers like 0 1 2 3 4 5 (as chars). but when i use that int, it just comes a bunch of numbers
-
July 27th, 2009, 04:50 PM
-
July 27th, 2009, 01:40 PM
I am using sockets to receive chars over 256 and as you know char has a range from -128 to 127. Theres my problem, i cannot use anything besides char to recv. Is there any way to convert it to...
|
Click Here to Expand Forum to Full Width
|