thank you!
that was it. everything is working now. i didn't expect any error state in such a simple case.
Type: Posts; User: symbiote
thank you!
that was it. everything is working now. i didn't expect any error state in such a simple case.
hi Guys,
i'm puzzled by the values i'm getting back from stringstream
#include <sstream>
#include <iostream>
int main(int argc, char* argv[])
{
hi and Welcome EyesOnly,
on windows, winsock has a similar API.
by connection i assume you mean you want to use TCP.
one of the differences is, on windows you have to call:
- WSAStartup()...
thanks for all the suggestions. i thought i'd close the topic properly because i already resolved this a while ago.
the problem was that i didn't understand the tcp shutdown sequence. i was...
thanks for the advice.
i have added exceptions.
i think i'll do what dra and matsp said ( destroy and create a new object ). keeps things simple and reflects the winsock documentation.
...
yeah. i guess it's not the best example. i was planning on adding error checking afterwards.
actually i don't want to make a copy because that would mean an other object with the same value is left...
oh i'm not familiar implementing ref counting. this is the code i was talking about
mySocket.h
#if !defined(_MYSOCKET_H)
#define _MYSOCKET_H
#include <string>
#include <winsock2.h>
when i overload the assignment operator the destructor of the temporary object still gets called.
if i change the data member of the assigning ( right hand ) object to a specific invalid value...
thanks,
well basicly this object is in this case a data member of a class (by value).
i prefer keeping things by value and i can see how you are right.
i don't really want to drift off topic...
hi Guys,
i got a question...
lets say i have a class "A" that can only be constructed with an int parameter
like this:
A objA(1);
hmm the tcp socket layer is telling me that my data got through when it didn't.
the recieving application had already closed the connection and even exitted (properly).
- how is everything...
hi brewbuck,
as you mentioned, a third attemp by the client gave an error ( 10053 - WSAECONNABORTED )
how am i supposed to know have figured out that the second attemp failed? ( adding...
hi trinli,
a call to WSAGetLastError() which retrieves the winsock error returns 0
( this should mean, no error if i remember )
i guess i could have expected that since send did not return -1...
i have been fidgeting with winsock tcp ( i created simple client and server applications with only a main function )
(i know this isn't the code but i'm trying to get the idea across i can post...
in tcp with accept
SOCKET accept( SOCKET s, struct sockaddr FAR* addr, int FAR* addrlen );
when i call:
i have been fidgeting winsock's udp.
the function recvfrom mainly:
int recvfrom( SOCKET s, char FAR* buf, int len, int flags, struct sockaddr FAR* from, int FAR* fromlen );
it has been...
thanks for the replies.
i almost forgot i asked this question.
i wanted a class that must to be initialized.
thanks edoceo. that's exactly what i was looking for.
Greetings
hi Guys,
i basicly want a class that has no default constructor as a data member of another class. something like this:
class A
{
public:
A( int x );
interesting.
thanks again laserlight (problem solved)
Greetings
thank you for your insight everyone!
i think i don't think i'll be passing primitive types by reference for reasons.
Greetings
hi Guys,
well i have a small issue (i think). i have a class that only contains one variable and i was wondering if i could assign an object of this class, to a variable of the same type as it's...
thanks for the response Phyxashun,
i see.
what i'm wondering now is, whether there is a cost in passing an int by reference.
- and if it exist, wheter it would be more or less than the copy of...
hi guys
i was wondering if i should rigorously stick to passing by reference.
i was wondering if someone knew what kind of effect passing a const int by reference would have? ( what about...
i've been experimenting with the winsock libray. and i'm still new to it so bear with me.
just an observation...
isn't a call to listen always followed by a call accept?
there must be a reason...
thanks baccardi