clsocket | lightweight set of classes that allow developers | Socket library
kandi X-RAY | clsocket Summary
kandi X-RAY | clsocket Summary
written by mark carrier to provide a mechanism for writing cross platform socket code. this library was originally written to only support blocking tcp sockets. over the years it has been extended to support udp and raw sockets as well. this is the first official release of the library and the following functionality is supported:. this is a very small library and is very easy to build and configure. to build and install make sure you are logged in as a user who has access to the recommend gnu installation directories. then type. make -build=release && make install. that is it now you are off and running. note: when using the library with windows you must define _win32 and when using with linux you must define _linux. network communications via sockets can be abstracted into two categories of functionality; the active socket and the passive socket. the active socket object initiates a connection with a known host, whereas the passive socket object waits (or listens) for inbound requests for communication. the functionality of both objects is identical as far as sending and receiving data. this library makes distinction between the two objects because the operations for constructing and destructing the two are
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of clsocket
clsocket Key Features
clsocket Examples and Code Snippets
Community Discussions
Trending Discussions on clsocket
QUESTION
We are just starting on migrating some of our projects to 64-bit in Delphi, we also have a couple of 3rd party Delphi libraries that we are using. Traditionally, when we use a 3rd party library we do so by using the design time package .bpl OR we just have the compiler compile the source code.
However, in 64-bit it seems we have to do it completely differently. If we are compiling a 64-bit library we need to use DCU.
For example, we have a library that we needed to use in 64-bit. The library supports 64-bit. To get it to work, I had to compile the runtime package as 64-bit then point the compiler to the outputted 64-bit DCU files. When I try to compile the library from source as 64-bit we get all kinds of errors.
So my question basically is: Why/How can we compile the source code through the runtime packages in 64-bit just fine, but when we try to compile as just source code in 64-bit we get errors?
To further illustrate just in case that wasn't clear:
A. Put all source files on search path. Compile program as 64-bit. ERRORS.
B. Open up supplied runtime .dproj from 3rd party library. Compile runtime library as 64-bit. Put outputted 64-bit DCU on search path. Compile program. Works fine.
Thanks
Edit: I'm going to be much more specific because it appears that i have failed in conveying what I'm trying to ask here.
We are using Clever Internet Suite 9.1 for Delphi. We DO NOT use the design time package when compiling in 32-bit. We link directly to the source code through Delphi's search path. This works fine.
When I change my application to build as 64-bit We get this error:
[dcc64 Error] clSocket.pas(1971): E2089 Invalid typecast
A sample of the offending code (Slightly changed):
...ANSWER
Answered 2019-Mar-06 at 20:19That compiler error is typically caused by a typecast between two value types of different size. If the code works in some compilation scenarios but not others then the obvious conclusion is that the record alignment options differ in those scenarios.
Most likely the package dproj file defines aligned records, i.e. {$ALIGN ON}
. But your project does not. Perhaps it uses packed alignment, {$ALIGN 1}
.
Make sure that all the units in the library are compiled with the same options as specified in the package dproj file. Typically that is done by the library providing an include file that specifies desired options and then the include file is included in all units. That insulates the code from compiler options specified in the host dproj file that are incompatible with those that the code requires.
You can add such a common include file since you have the source. In the longer term you should ask the developers of the library to make their code standalone and not require external specification of critical compiler options.
QUESTION
I am wondering how i would be able to send a message from the server back to the client. I'm new to Java and have searched up the problem however the code used is unfamiliar to what i've been learning with. I've tried to do it however i cannnot quite get it to send the message back to the client.
I want to sent the message "message revieved" from the server to the client once the client sends the message "first" to the server.
Any help with explanation would be really appreciated!
Client Code:
...ANSWER
Answered 2017-Nov-10 at 04:04I have found the problems and fixed them in both classes for you, but before I give you the code, let's talk about why yours didn't exactly work.
In the client
code, you set up the stream correctly, and connected to the server, but right after you were trying to send a message to the server, there was this piece of code:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install clsocket
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page