<?xml version='1.0' encoding='iso-8859-1'?><rss version='2.0'><channel><title>C++ Sockets library</title><link>http://www.alhem.net/bbs?board=538</link><description>Message board</description><pubDate>Sat, 04 Feb 2012 20:05:01 GMT</pubDate><lastBuildDate>Sat, 24 Nov 2007 16:59:29 GMT</lastBuildDate><generator>www.alhem.net</generator><managingEditor>grymse@telia.com</managingEditor><ttl>180</ttl><item><title>Size of the receive buffer in DisplayRawSocket and an parallel programming question</title><link>http://www.alhem.net/bbs?subject=70253</link><description>Hallo,

I&apos;m a beginner socket-Programmer/user so I hope this question wont sound too stupid :). I have programmed a Client and a Server. Client is executed with MPI so there are several instances of it sending at once. Currently I&apos;m trying to send about 26000 bytes in one message (its simulation data) to the server. My problem is, that the received message is divided in two. So I&apos;m always getting like 16400 bytes at once and then the rest next time. 
My question: Is it possible to increase the receive-buffer size and get the message at once? If yes, how?
My 2nd question: Because I&apos;m sending the data parallel to just 1 server. Is there a possibility to write all the received information to 1 array. I think there is 1 thread for every connection incoming, isn&apos;t it? Or is there a kind of &quot;fork&quot;?
I hope you can answer my questions - thanks in advance</description><guid>http://www.alhem.net/bbs?subject=70253</guid></item><item><title>Link error in VS2010</title><link>http://www.alhem.net/bbs?subject=70252</link><description>Tried to simply use the DisplaySocket code. Get a link error:
1&gt;------ Build started: Project: TestSocketsClient, Configuration: Debug Win32 ------
1&gt;  DisplaySocket.cpp
1&gt;msvcprtd.lib(MSVCP100D.dll) : error LNK2005: &quot;public: __thiscall std::_Container_base12::~_Container_base12(void)&quot; (??1_Container_base12@std@@QAE@XZ) already defined in Sockets.lib(TcpSocket.obj)
1&gt;msvcprtd.lib(MSVCP100D.dll) : error LNK2005: &quot;public: __thiscall std::_Container_base12::_Container_base12(void)&quot; (??0_Container_base12@std@@QAE@XZ) already defined in Sockets.lib(TcpSocket.obj)
1&gt;msvcprtd.lib(MSVCP100D.dll) : error LNK2005: &quot;public: void __thiscall std::_Container_base12::_Orphan_all(void)&quot; (?_Orphan_all@_Container_base12@std@@QAEXXZ) already defined in Sockets.lib(TcpSocket.obj)
1&gt;LINK : warning LNK4098: defaultlib &apos;LIBCMTD&apos; conflicts with use of other libs; use /NODEFAULTLIB:library</description><guid>http://www.alhem.net/bbs?subject=70252</guid></item><item><title>Linux 64-bit Use</title><link>http://www.alhem.net/bbs?subject=70250</link><description>EDIT - please disregard. When I made the change described, I also enabled Exceptions by accident. My code to catch exceptions had a bonehead error.


I started compiling for Mac 64-bit a while ago, and the library didn&apos;t squawk, but now I&apos;ve tried to make a Linux 4-bit version and it&apos;s not so simple?

Stepping through my socket creation, it all seems fine - no errors or exceptions, but then I have no ports open, afaict. If I send from one of my Multicast sockets, I see the data back, and IP and port look right. But my listen sockets etc. don&apos;t seem to be there.

Do I need to do anything? A define or something? I&apos;m on 2.3.9, I think. I notice there&apos;s a make setting for Linux 32, not for 64, but Mac didn&apos;t care.

Bruce</description><guid>http://www.alhem.net/bbs?subject=70250</guid></item><item><title>Mac &amp; Linux 2.3.9.7 Fixes</title><link>http://www.alhem.net/bbs?subject=70251</link><description>The HTTPRequest (FILE) constructor needs to be for Linux only, AFAICT:

#if  !defined (_WIN32)  &amp;&amp; !defined (MACOSX)
	HttpRequest(FILE *);
#endif

And the same in the cpp file.

Also in HTTPRequest.cpp, need to include:

#include &lt;iostream&gt;

For Mac &amp; Linux 64-bit.

Bruce</description><guid>http://www.alhem.net/bbs?subject=70251</guid></item><item><title>usage of the C++ socket library </title><link>http://www.alhem.net/bbs?subject=70091</link><description>Hello,
I downloaded the source code in &quot;Sockets-2.3.5.tar.gz&quot;. I guess all builds are ok, because the &quot;make&quot; command produced no error message. What do I make to use the compiled library for my C++ project. It is not clear to me, after reading the INSTALL document.

Ok, I made the mistake to forget the &quot;make install&quot; command. I done this currently. Because of the output, I think there is no error:

&quot;cp libSockets.a //usr/local/lib
cp -a *.h //usr/local/include/Sockets&quot;.

But, what have I do now? I get the following output after compiling my project:

&quot;make: *** Keine Regel vorhanden, um das Target »TcpSocket.h«, 
  benötigt von »DisplaySocket.o«, zu erstellen.  Schluss.&quot;.

Das mean there ar no rules available for &quot;TcpSocket.h&quot;, which ist necessary to create &quot;DisplaySocket.o&quot;.

I suppose my makefile is wrong. Here is tha content:

&quot;objects = DisplaySocket.o

socket : $(objects)
	cc -o socket $(objects)

DisplaySocket.o : DisplaySocket.h TcpSocket.h ISocketHandler.h

.PHONY : clean
clean : 
	rm socket $(objects)&quot;

I not good in writting makefiles. What do you think, what have I add to solve the problem?


greetings,
lowrider</description><guid>http://www.alhem.net/bbs?subject=70091</guid></item><item><title>Send email through SMTP server</title><link>http://www.alhem.net/bbs?subject=70186</link><description>Hi! 

I wanna use SmtpdSocket to send e-mail through own SMTP server. Is it possible? I can&apos;t found any example for this! Dear Grymse, if it possible, please show how to do this.</description><guid>http://www.alhem.net/bbs?subject=70186</guid></item><item><title>lion 7.10.2 mac os make error</title><link>http://www.alhem.net/bbs?subject=70249</link><description>Change the &apos;PLATFORM =&apos; line in Makefile like this &apos;PLATFORM = macosx&apos;


LeoChristMacBook-Pro:Sockets-2.3.9.7 leochrist$ make
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o Ajp13Socket.o Ajp13Socket.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o AjpBaseSocket.o AjpBaseSocket.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o Base64.o Base64.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o Debug.o Debug.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o Event.o Event.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o EventHandler.o EventHandler.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o EventTime.o EventTime.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o Exception.o Exception.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o File.o File.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o FileStream.o FileStream.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o HTTPSocket.o HTTPSocket.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o HttpBaseSocket.o HttpBaseSocket.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o HttpClientSocket.o HttpClientSocket.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o HttpDebugSocket.o HttpDebugSocket.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o HttpGetSocket.o HttpGetSocket.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o HttpPostSocket.o HttpPostSocket.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o HttpPutSocket.o HttpPutSocket.cpp
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DMACOSX    -c -o HttpRequest.o HttpRequest.cpp
HttpRequest.cpp: In constructor ‘HttpRequest::HttpRequest(FILE*)’:
HttpRequest.cpp:74: error: ‘environ’ was not declared in this scope
make: *** [HttpRequest.o] Error 1

how to make it ?</description><guid>http://www.alhem.net/bbs?subject=70249</guid></item><item><title>Compiling warnings</title><link>http://www.alhem.net/bbs?subject=70248</link><description>Hello, I receive several strange output when running make on my Ubuntu 11.04 box:


ar cru libSockets.a Ajp13Socket.o AjpBaseSocket.o Base64.o Debug.o Event.o EventHandler.o EventTime.o Exception.o File.o FileStream.o HTTPSocket.o HttpBaseSocket.o HttpClientSocket.o HttpDebugSocket.o HttpGetSocket.o HttpPostSocket.o HttpPutSocket.o HttpRequest.o HttpResponse.o HttpTransaction.o HttpdCookies.o HttpdForm.o HttpdSocket.o IEventOwner.o Ipv4Address.o Ipv6Address.o Json.o Lock.o MemFile.o Mutex.o Parse.o ResolvServer.o ResolvSocket.o SSLInitializer.o SctpSocket.o SmtpdSocket.o Socket.o SocketHandler.o SocketHandlerEp.o SocketHandlerThread.o SocketStream.o SocketThread.o StdoutLog.o StreamSocket.o StreamWriter.o TcpSocket.o Thread.o UdpSocket.o Utility.o XmlDocument.o XmlNode.o XmlException.o Semaphore.o
ranlib libSockets.a
g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.7&quot;&apos; -O2 -DLINUX -fPIC   -c -o Sockets-config.o Sockets-config.cpp
Sockets-config.cpp: In function &apos;void set_namespace(const char*)&apos;:
Sockets-config.cpp:325:25: warning: ignoring return value of &apos;char* fgets(char*, int, FILE*)&apos;, declared with attribute warn_unused_result
Sockets-config.cpp:350:26: warning: ignoring return value of &apos;char* fgets(char*, int, FILE*)&apos;, declared with attribute warn_unused_result
Sockets-config.cpp: In function &apos;void replace_makefile(const std::string&amp;, const std::string&amp;)&apos;:
Sockets-config.cpp:252:25: warning: ignoring return value of &apos;char* fgets(char*, int, FILE*)&apos;, declared with attribute warn_unused_result
Sockets-config.cpp:268:26: warning: ignoring return value of &apos;char* fgets(char*, int, FILE*)&apos;, declared with attribute warn_unused_result
Sockets-config.cpp: In function &apos;void show_configuration()&apos;:
Sockets-config.cpp:188:25: warning: ignoring return value of &apos;char* fgets(char*, int, FILE*)&apos;, declared with attribute warn_unused_result
Sockets-config.cpp:210:26: warning: ignoring return value of &apos;char* fgets(char*, int, FILE*)&apos;, declared with attribute warn_unused_result
Sockets-config.cpp:220:25: warning: ignoring return value of &apos;char* fgets(char*, int, FILE*)&apos;, declared with attribute warn_unused_result
Sockets-config.cpp:231:26: warning: ignoring return value of &apos;char* fgets(char*, int, FILE*)&apos;, declared with attribute warn_unused_result
Sockets-config.cpp: In function &apos;void set(const char*, bool)&apos;:
Sockets-config.cpp:148:25: warning: ignoring return value of &apos;char* fgets(char*, int, FILE*)&apos;, declared with attribute warn_unused_result
Sockets-config.cpp:169:26: warning: ignoring return value of &apos;char* fgets(char*, int, FILE*)&apos;, declared with attribute warn_unused_result
g++  -o Sockets-config Sockets-config.o


Any ideas on how can I get rid of these warnings?

Thanks</description><guid>http://www.alhem.net/bbs?subject=70248</guid></item><item><title>HttpClientSocket::Complete() returns true even on timeout</title><link>http://www.alhem.net/bbs?subject=70247</link><description>Hi,
I tried to connect to a not exiting server but HttpClientSocket::Complete() returns always true even when the connection time-out. 
I.m using 2.3.9.7 on linux</description><guid>http://www.alhem.net/bbs?subject=70247</guid></item><item><title>blank string returned when using GetRemoteAddress()</title><link>http://www.alhem.net/bbs?subject=70246</link><description>getting a blank string returned by calling GetRemoteAddress() and GetRemotehostname() on HP itanium. The server and client are on two different machines. Have tried commenting and uncommenting NO_GETADDRINFO in sockets_config.h but it does not help. Any other solutions?</description><guid>http://www.alhem.net/bbs?subject=70246</guid></item><item><title>Fixing code in order to compile Sockets-2.3.3</title><link>http://www.alhem.net/bbs?subject=70082</link><description>Hello, based on http://www.alhem.net/cgi-bin/bbs/boards?subject=70054 I created some .diff archives in order to patch against the official Sockets-2.3.3.tar.gz and be able to compile it and use it:

Preconfiguration
================
[sockets-config.h]
- HAVE_OPENSSL
- USE_SCTP
- NO_GETADDRINFO
- ENABLE_POOL
- ENABLE_SOCKS4
- ENABLE_RESOLVER
- ENABLE_RECONNECT
- ENABLE_DETACH
- ENABLE_EXCEPTIONS
- ENABLE_XML
- ENABLE_RESOLVER

[Makefile]
PREFIX = usr


.diff archives
==============
[FileStream.cpp.diff]
33a34,37
&gt; #ifdef SOCKETS_NAMESPACE
&gt; namespace SOCKETS_NAMESPACE {
&gt; #endif
&gt; 
51a56,58
&gt; #ifdef SOCKETS_NAMESPACE
&gt; }
&gt; #endif

[Socket.cpp.diff]
51a52,54
&gt; #ifdef ENABLE_IPV6
&gt; #include &quot;Ipv6Address.h&quot;
&gt; #endif

[SocketStream.cpp.diff]
35a36,39
&gt; #ifdef SOCKETS_NAMESPACE
&gt; namespace SOCKETS_NAMESPACE {
&gt; #endif
&gt; 
58a63,66
&gt; #ifdef SOCKETS_NAMESPACE
&gt; }
&gt; #endif
&gt; 

[StreamWriter.cpp.diff]
81,87d80
&lt; StreamWriter&amp; StreamWriter::operator&lt;&lt;(int64_t x)
&lt; {
&lt;   *this &lt;&lt; Utility::bigint2string(x);
&lt;   return *this;
&lt; }
&lt; 
&lt; 

[ StreamWriter.h.diff]
54d53
&lt; 	StreamWriter&amp; operator&lt;&lt;(int64_t);


Patching
========
With this .diff archives and &apos;Sockets-2.3.3.tar.gz&apos; in &apos;/home/your_username/&apos;:

$ ls -1
FileStream.cpp.diff
Socket.cpp.diff
Sockets-2.3.3.tar.gz
SocketStream.cpp.diff
StreamWriter.cpp.diff
StreamWriter.h.diff

Extract &apos;Sockets-2.3.3.tar.gz&apos;:

$ tar xzf Sockets-2.3.3.tar.gz
$ cd Sockets-2.3.3

And then apply the patches:

$ for patch in $(ls ../*.diff); do original=${patch%.diff}; original=${original:3}; echo -n Patching: $original...; patch -s $original $patch; echo ok; done

Finally compile it:

$ make

Hope can use version 2.3.3.
</description><guid>http://www.alhem.net/bbs?subject=70082</guid></item><item><title>Sockets-2.3.9.7</title><link>http://www.alhem.net/bbs?subject=70242</link><description>Sockets-2.3.9.7 release comments</description><guid>http://www.alhem.net/bbs?subject=70242</guid></item><item><title>m_obuf_top access concurrency error</title><link>http://www.alhem.net/bbs?subject=70244</link><description>Hello, I&apos;m having crashes on TcpSocket::Buffer when the server is heavily loaded.

The problem is that on this check 
 TcpSocket::Buffer()
   -&gt; &quot;m_obuf_top ? m_obuf_top -&gt; Space()&quot;

because m_obuf_top exists but is deleted just before m_obuf_top-&gt;Space() by other thread  that runs the 
 SocketHandler::Select()
  -&gt; TcpSocket::OnWrite() 
   -&gt; TcpSocket::SendFromOutputBuffer()
    -&gt; m_obuf_top = NULL;

I have protected the writes but I didn&apos;t account for that writes can also be done in the select. I think that protecting also the select will be bad as if we have many sockets they will be all locked while operations might need to be performed only in a small set of them.

Any ideas? Thanks.</description><guid>http://www.alhem.net/bbs?subject=70244</guid></item><item><title>How to Start Stop Server</title><link>http://www.alhem.net/bbs?subject=70245</link><description>Hi,
I use a class to manage my server.
I have the following methods
bool MultiClientServer::InitServer()
{
	try
	{
		l.Bind(SERVERPORT, 20);
		h.Add(&amp;l);
	}
	catch (const Exception&amp; e)
	{
		return false;
	}
	return true;
}
bool MultiClientServer::CloseServer()
{
	SendRTIMsgToAll(rtimsg_server_quit, 0, 0, 0, &quot;bye&quot;);

	isStart = false;

	return true;
}
bool MultiClientServer::StartServer()
{
	isStart = true;

	_thread = reinterpret_cast&lt;HANDLE&gt;(_beginthreadex(0, 0, &amp;MultiClientServer::threadHandleClients, this, 0, 0));
	if( _thread == 0 )
		return false;
	return true;

}
void MultiClientServer::AcceptConnections()
{
	h.Select(1,0);
	while (h.GetCount() &amp;&amp; isStart)
	{
		h.Select(1,0);
	}
	isStart = false;
}

But if I call CloseServer, I can connect to the Server but I can&apos;t communicate with it.

What do I miss to complete close the Server?

Thank You</description><guid>http://www.alhem.net/bbs?subject=70245</guid></item><item><title>SetNumberOfThreads question</title><link>http://www.alhem.net/bbs?subject=70241</link><description>Hi, I&apos;m testing the SetNumberOfThreads feature included in version 2.3.9.3 and I would like how the connections are split in threads. I made a small program that use sockets and verified that if I specify to use 64 threads, all threads are created in the program startup ( saw it using ps -eLf ).

Another doubt is if the FD_SET structures are split to each thread ( for example, if I set the number to 100 and the FD_SETSIZE is 512 I&apos;ll be able to use +/- 51200 connections, or one FD_SET is shared by all threads? )</description><guid>http://www.alhem.net/bbs?subject=70241</guid></item><item><title>Sockets-2.3.9.6</title><link>http://www.alhem.net/bbs?subject=70240</link><description>Sockets-2.3.9.6 release comments</description><guid>http://www.alhem.net/bbs?subject=70240</guid></item><item><title>WLAN Packet Loss</title><link>http://www.alhem.net/bbs?subject=70239</link><description>Hi,
i&apos;m kinda new to socket programming. I have a Gentoo Box with Xenomai Realtime extension running a real-time control-loop. Additionaly I have a secondary non-realtime thread running a TCP-Server. Goal is to get some monitoring data from the real-time-thread and send it via TCP/IP to a client pc. I need to make sure that no packet get lost (necessary condition!)! I implemented TCP-server/client with c++-sockets. If I use a wired connection between server and host I get (as expected) no packet loss . If I use a wireless link though, i regulary loose packets. I know TCP has been designed for wired-connections and has some problems with wireless, but I expected a more reliable connection. The data I send is very small (like 500 Byte) but send regulary (~250 Hz). I use a 802.11g-type link.

On Client-Side I use OnRawData()-Callback to read data. At first I thought there are a lot of connection losses, but the IsConnected()-Flag always stays on true. I already tried advanced congestion control algorithm like Westwood-TCP without success, but I think the solution is simpler? Anyone has experience with such a problem? Maybe the problem is, that I use no application layer protocol such as http, but directly TCP? 

Regards,
Ole</description><guid>http://www.alhem.net/bbs?subject=70239</guid></item><item><title>Mingw Sockets Library Semaphore.h</title><link>http://www.alhem.net/bbs?subject=70237</link><description>I want to add the Sockets library (version 2.3.9.5) at http://www.alhem.net/Sockets/index.html to my compiler (Mingw32 version 4.5.2).

I am not using cygwin, I am using the windows port of mingw32.

I was able to compile the library using mingw32-make.

However, I am having difficulty in compiling an example that came with the library source. Specifically, &quot;echoserver.cpp&quot;.

When I initially tried to compile this program, I did not tell mingw where the newly compiled library was; obviously a lot of errors where thrown.

I looked into how to add said library to mingw.

With that info, I decided to dump the library into the &lt;mingw install root&gt;\lib directory. I included all of the .o and .d files along with &quot;libSockets.a&quot;.

Next, I dumped everything else (.cpp, .h) into the &lt;mingw install root&gt;\include directory. Here I had one problem crop up- &quot;semaphore.h&quot; was a duplicate (it was in the newly compiled directory, and there was a copy in the &lt;mingw install root&gt;\include directory).

I renamed the copy that had already been there (which is larger than the one that I compiled).

Now, when I try to compile echoserver.cpp, I have far fewer errors than my first attempt to compile. Note- vast majority of errors in each case are &quot;undefined referrence to XXX&quot;.

This suggests to me that I went a step in the right direction.

Now, I have had to tell mingw to use the library when I go to compile, using the &quot;-l&quot; switch. I think the issue I have now involves the semaphore.h file, which has stuff in it that referrence a threading library, namely &quot;pthreads&quot;.

I am not sure if the pthreads lib I grabbed is the right one. In fact, I have two files I dloaded- one is &quot;libpthreadGC2.a&quot; and the other is &quot;libpthreadGCE2.a&quot;, and I forget where I got them from (though I do remember trusting the site).

So, what I need is a brief explanation of what is going on here- why wasn&apos;t &quot;pthreads&quot; in the system32 directory? What should I do with the semaphore.h files?

Some commands:

[code]

mingw32-c++ echoserver.cpp -o /c/echoserver.exe -lSockets -lws2_32 -lwsock32 -lpthreadGC2 -lpthreadGCE2

[/code]

produces:

[code]

In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/Socket.h:46:0,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ISocketHandler.h:40,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ListenSocket.h:42,
                 from echoserver.cpp:27:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/Thread.h:115:2: error: &apos;Semaphore&apos; does not name a type

[/code]

(Note- above output due to using the semaphore.h file that came from mingw, NOT the file I compiled).

The below example is with the semaphore.h file that I compiled.

[code]


produces:

[code]


C:\Users\DKOVAC~1\AppData\Local\Temp\ccAO9Vef.o:echoserver.cpp:(.text$_ZN12ListenSocketI8MySocketE4BindER13SocketAddressRKSsi[ListenSocket&lt;MySocket&gt;::Bind(SocketAddress&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int)]+0xfe): undefined reference to `StrError(int)&apos;
C:\Users\DKOVAC~1\AppData\Local\Temp\ccAO9Vef.o:echoserver.cpp:(.text$_ZN12ListenSocketI8MySocketE4BindER13SocketAddressRKSsi[ListenSocket&lt;MySocket&gt;::Bind(SocketAddress&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int)]+0x1ad): undefined reference to `StrError(int)&apos;
C:\Users\DKOVAC~1\AppData\Local\Temp\ccAO9Vef.o:echoserver.cpp:(.text$_ZN12ListenSocketI8MySocketE4BindER13SocketAddressRKSsi[ListenSocket&lt;MySocket&gt;::Bind(SocketAddress&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int)]+0x2dc): undefined reference to `StrError(int)&apos;
C:\Users\DKOVAC~1\AppData\Local\Temp\ccAO9Vef.o:echoserver.cpp:(.text$_ZN12ListenSocketI8MySocketE4BindER13SocketAddressRKSsi[ListenSocket&lt;MySocket&gt;::Bind(SocketAddress&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int)]+0x38b): undefined reference to `StrError(int)&apos;
C:\Users\DKOVAC~1\AppData\Local\Temp\ccAO9Vef.o:echoserver.cpp:(.text$_ZN12ListenSocketI15HttpDebugSocketE4BindER13SocketAddressRKSsi[ListenSocket&lt;HttpDebugSocket&gt;::Bind(SocketAddress&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int)]+0xfe): undefined reference to `StrError(int)&apos;
C:\Users\DKOVAC~1\AppData\Local\Temp\ccAO9Vef.o:echoserver.cpp:(.text$_ZN12ListenSocketI15HttpDebugSocketE4BindER13SocketAddressRKSsi[ListenSocket&lt;HttpDebugSocket&gt;::Bind(SocketAddress&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int)]+0x1ad): more undefined references to `StrError(int)&apos; follow
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(Thread.o): In function `Thread&apos;:
c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/Thread.cpp:54: undefined reference to `Semaphore::Semaphore(long)&apos;
c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/Thread.cpp:73: undefined reference to `Semaphore::Post()&apos;
c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/Thread.cpp:54: undefined reference to `Semaphore::~Semaphore()&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(Thread.o): In function `~Thread&apos;:
c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/Thread.cpp:77: undefined reference to `Semaphore::~Semaphore()&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(Thread.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/Thread.cpp:146: undefined reference to `Semaphore::Post()&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(Thread.o): In function `~Thread&apos;:
c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/Thread.cpp:77: undefined reference to `Semaphore::~Semaphore()&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(Thread.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/Thread.cpp:170: undefined reference to `Semaphore::Wait()&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(ResolvServer.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/ListenSocket.h:341: undefined reference to `StrError(int)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(ResolvServer.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/ListenSocket.h:290: undefined reference to `StrError(int)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(ResolvServer.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/ListenSocket.h:293: undefined reference to `StrError(int)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(ResolvServer.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/ListenSocket.h:299: undefined reference to `StrError(int)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(ResolvServer.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/ListenSocket.h:302: undefined reference to `StrError(int)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(SocketHandlerThread.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/SocketHandlerThread.cpp:63: undefined reference to `Semaphore::Post()&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(SocketHandlerThread.o): In function `~SocketHandlerThread&apos;:
c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/SocketHandlerThread.cpp:48: undefined reference to `Semaphore::~Semaphore()&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(SocketHandlerThread.o): In function `SocketHandlerThread&apos;:
c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/SocketHandlerThread.cpp:43: undefined reference to `Semaphore::Semaphore(long)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(SocketHandlerThread.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/SocketHandlerThread.cpp:75: undefined reference to `Semaphore::Wait()&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(UdpSocket.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/UdpSocket.cpp:371: undefined reference to `StrError(int)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(UdpSocket.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/UdpSocket.cpp:556: undefined reference to `StrError(int)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(UdpSocket.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/UdpSocket.cpp:531: undefined reference to `StrError(int)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(UdpSocket.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/UdpSocket.cpp:229: undefined reference to `StrError(int)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(UdpSocket.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/UdpSocket.cpp:327: undefined reference to `StrError(int)&apos;
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libSockets.a(UdpSocket.o):c:\Users\dkovacevic\Downloads\Binaries_and_Sources\C++\Sockets-2.3.9.5/UdpSocket.cpp:581: more undefined references to `StrError(int)&apos; follow
collect2: ld returned 1 exit status

[/code]

Any advice?
</description><guid>http://www.alhem.net/bbs?subject=70237</guid></item><item><title>compile error</title><link>http://www.alhem.net/bbs?subject=70164</link><description>I ran mingw32-make install and got the error of:

g++  -Wall -g -I/usr/include/libxml2 -MD -D_VERSION=&apos;&quot;2.3.9.2&quot;&apos; -O2 -mno-cygwin
-D_WIN32 -D__CYGWIN__   -c -o Ajp13Socket.o Ajp13Socket.cpp
In file included from Socket.h:43,
                 from StreamSocket.h:36,
                 from TcpSocket.h:35,
                 from AjpBaseSocket.h:36,
                 from Ajp13Socket.h:36,
                 from Ajp13Socket.cpp:36:
socket_include.h: In constructor &apos;WSAInitializer::WSAInitializer()&apos;:
socket_include.h:240: error: &apos;exit&apos; was not declared in this scope
mingw32-make: *** [Ajp13Socket.o] Error 1

I&apos;m not sure why I&apos;m getting this error?</description><guid>http://www.alhem.net/bbs?subject=70164</guid></item><item><title>Cygwin compiling issues (Windows)</title><link>http://www.alhem.net/bbs?subject=70233</link><description>Hi there,
I tried to compile the library today but when I run make I hit this problem:

--
g++  -Wall -g -I/usr/include/libxml2  -MD -D_VERSION=&apos;&quot;2.3.9.5&quot;&apos; -O2 -mno-cygwin -D_WIN32 -D__CYGWIN__   -c -o Json.o Json.cpp

Json.cpp:205: error: no `std::map&lt;std::string, Json, std::less&lt;std::string&gt;, std::allocator&lt;std::pair&lt;const std::string, Json&gt; &gt; &gt;&amp; Json::GetObjectA()&apos; member function declared in class `Json&apos;

Json.cpp:225: error: no `const std::map&lt;std::string, Json, std::less&lt;std::string&gt;, std::allocator&lt;std::pair&lt;const std::string, Json&gt; &gt; &gt;&amp; Json::GetObjectA() const&apos; member function declared in class `Json&apos;

make: *** [Json.o] Error 1
--

Am I missing something?
If I need to provide more information, please say so.

I Have GCC 3.4.4</description><guid>http://www.alhem.net/bbs?subject=70233</guid></item><item><title>problems with header files in c++ </title><link>http://www.alhem.net/bbs?subject=70236</link><description>Hello,

I would like to ask you,if you might know the solution for the problem,
when I want to include BSD Socket Api files in my programs the compiler just does&apos;nt compile because it says that the header fille has not been found.
</description><guid>http://www.alhem.net/bbs?subject=70236</guid></item><item><title>make issues on ubuntu 11 regarding stdio ( vsnprintf )</title><link>http://www.alhem.net/bbs?subject=70235</link><description>I downloaded the library and followed the commands on the Readme.txt file. The &quot;type make&quot; step didnt work as easily as expected...
i found the first problem in HTTPSocket, where the compiler wasnt able to resolve vsnprintf...after looking for a way to resolve this issue i found an entry where &quot;DMG&quot; gave a solution, include stdio.h in HTTPSocket.h.
I had similar issues with printf, in SocketHandler.h and Stdoutlog.h, solved in the same way.</description><guid>http://www.alhem.net/bbs?subject=70235</guid></item><item><title>TimeOut()</title><link>http://www.alhem.net/bbs?subject=70234</link><description>Hello.

Let me say that I have a function called &quot;doSomething()&quot; and I want to abort its execution after 3 seconds.

Is there some function in this library doing it with some kind of thread?

Thanks.

Regards,

Islen

</description><guid>http://www.alhem.net/bbs?subject=70234</guid></item><item><title>[BUG] Port numbers are no longer update when bind is called with a range.</title><link>http://www.alhem.net/bbs?subject=70232</link><description>In UdpSocket.cpp, line 82-95 is:
int UdpSocket::Bind(port_t &amp;port, int range)
{
#ifdef ENABLE_IPV6
#ifdef IPPROTO_IPV6
	if (IsIpv6())
	{
		Ipv6Address ad(port);
		return Bind(ad, range);
	}
#endif
#endif
	Ipv4Address ad(port);
	return Bind(ad, range);
}

The interface implies that port will be updated with the bound port number, and probably did before the introduction of Ipv4Address.  However, with the introduction of the Ipv4Address, port is no longer getting updated.  There are several instances of this issue.  Either the function interface should make port not a reference, or it should update the port number after binding.</description><guid>http://www.alhem.net/bbs?subject=70232</guid></item><item><title>MSVC 2008 no longer builds</title><link>http://www.alhem.net/bbs?subject=70231</link><description>There appears to be a problem with the building on VC2008.

int64_t is not defined.  On line 54 of socket_include.h is:
typedef unsigned __int64 uint64_t;
There ought to be a 
typedef __int64 int64_t;
because that typedef is also required.

Worth noting on VC2010, stdint.h is part of the installation, so it might be better to replace the #ifdef _WIN32 on line 53 with a #ifndef _HAVE_STDINT_H_ or something.</description><guid>http://www.alhem.net/bbs?subject=70231</guid></item><item><title>Older Versions of Sockets</title><link>http://www.alhem.net/bbs?subject=70230</link><description>Where can I download them? I am trying to build the library in Visual Studio 2010 on Windows, and it is giving me errors. Where can I find older versions?</description><guid>http://www.alhem.net/bbs?subject=70230</guid></item><item><title>error on select() when socket is closed by socket handler</title><link>http://www.alhem.net/bbs?subject=70229</link><description>Hello,

I am using Sockets-2.3.9.4. I tried the tutorial example http://www.alhem.net/Sockets/tutorial/using1e.html but the Socket Handler generated an error message &quot;error on select()&quot; when unreachable destination.

I have another socket listening so that I only changed the last line to
while ()
  h.Select(1, 0);


I do not know if the error msg is a real error or only a warning.

Action performed on socket:

2011-02-25 15:23:13 :: fd 3 :: tcp: connect failed: 111 Connection refused (Fatal)
INFO    : virtual void OnConnectFailed()  : OnConnectFailed event
INFO    : virtual void OnDelete() : OnDelete event
error on select(): 9 Bad file descriptor

Thank you for info.

Regards
Martin</description><guid>http://www.alhem.net/bbs?subject=70229</guid></item><item><title>error on select() when socket is closed by socket handler</title><link>http://www.alhem.net/bbs?subject=70228</link><description>Hello,

I am using Sockets-2.3.9.4. I tried the tutorial example http://www.alhem.net/Sockets/tutorial/using1e.html but the Socket Handler generated an error message &quot;error on select()&quot; when unreachable destination.

I have another socket listening so that I only changed the last line to
while ()
  h.Select(1, 0);


I do not know if the error msg is a real error or only a warning.

Action performed on socket:

2011-02-25 15:23:13 :: fd 3 :: tcp: connect failed: 111 Connection refused (Fatal)
INFO    : virtual void OnConnectFailed()  : OnConnectFailed event
INFO    : virtual void OnDelete() : OnDelete event
error on select(): 9 Bad file descriptor

Thank you for info.

Regards
Martin</description><guid>http://www.alhem.net/bbs?subject=70228</guid></item><item><title>listen socket - filtering based on IP and only one client generate warning</title><link>http://www.alhem.net/bbs?subject=70227</link><description>Hello,

please, could someone help me, how to correctly make a filtering based on IP and to allow only one client connection?

I have read these topics and made mix of it.
http://www.alhem.net/cgi-bin/bbs/zz?subject=24265&amp;q=SetCloseAndDelete
http://www.alhem.net/cgi-bin/bbs/zz?subject=69817&amp;q=SetCloseAndDelete

I have defined logic in the OnAccept() callback but when I am trying to close the connection by calling SetCloseAndDelete() from OnAccept(), the socket handler generates warning - &quot;2011-02-18 15:24:43 :: fd 7 :: Add: 7 Added socket with SetCloseAndDelete() true (Warning)&quot;

I would like to get rid of this warning without making some queue or status flags which socket should be closed.

Thank you for your help
Martin






</description><guid>http://www.alhem.net/bbs?subject=70227</guid></item><item><title>Support for unicode character</title><link>http://www.alhem.net/bbs?subject=70226</link><description>I have downloaded &apos;Sockets-2.3.9.3&apos; . I am trying to create a server using lib which prints the character it reads. I am using &apos;OnRawData&apos; ,
printf(&quot;%x&quot;,buf); While i am trying to print characters like &apos;&amp;#65269;&apos; i was expecting it to print hex value as FEF5 but it is always printing 3f ?
Does the C++ socket library supports for unicode characters also ? How do i print these characters </description><guid>http://www.alhem.net/bbs?subject=70226</guid></item></channel></rss>
