24件ヒット
[1-24件を表示]
(0.099秒)
検索結果
-
TCPServer (8025.0)
-
TCP/IP ストリーム型接続のサーバ側のソケットのクラスです。
...ire "socket"
gs = TCPServer.open(0)
socks = [gs]
addr = gs.addr
addr.shift
printf("server is on %s\n", addr.join(":"))
while true
nsock = select(socks)
next if nsock == nil
for s in nsock[0]
if s == gs
socks.push(s.accept)
print(s, " is accepted\n"......と短くなります。
require "socket"
gs = TCPServer.open(0)
addr = gs.addr
addr.shift
printf("server is on %s\n", addr.join(":"))
while true
Thread.start(gs.accept) do |s| # save to dynamic variable
print(s, " is accepted\n")
while s.gets
s.write... -
OpenSSL
:: SSL :: SSLServer (13.0) -
SSL サーバーのためのクラス。
...SSL サーバーのためのクラス。
TCPServer をラップするクラスで、TCPServer で接続した
ソケットを OpenSSL::SSL::SSLSocket でラップする機能を持ちます。
おおよそ TCPServer と同様のメソッドを持ちます。
基本的には SSL サーバを簡単......'socket'
require 'openssl'
include OpenSSL
ctx = SSL::SSLContext.new()
ctx.cert = X509::Certificate.new(File.read('cert.pem'))
ctx.key = PKey::RSA.new(File.read('privkey.pem'))
svr = TCPServer.new(2007)
serv = SSL::SSLServer.new(svr, ctx)
loop do
while soc = serv.accept...